Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GetWeaponRatio for readability in TakeDamage forward #956

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

justgo97
Copy link

No behavior changes introduced.

@Vaqtincha
Copy link
Contributor

#600

more functionality and practicality

@justgo97
Copy link
Author

#600

more functionality and practicality

Yes your PR has more functionality, this PR doesn't contradict yours and it's easy to review, you can still submit your changes if this one gets merged.

@Vaqtincha
Copy link
Contributor

@justgo97 take it (with the latest changes) you can add it to this pr

@justgo97
Copy link
Author

@justgo97 take it (with the latest changes) you can add it to this pr

Maybe in another PR if this one gets passed, I want to see first if this repo is still active and accepts changes like this, I have more changes not related to this function in my local fork.

@Vaqtincha
Copy link
Contributor

@justgo97 Do not misunderstand me. It's better to do such things perfectly. Then changing it will be problematic due to backward compatibility

@dystopm
Copy link
Contributor

dystopm commented May 13, 2024

A few recommendations to make this even better:

  • add more parameters to the function, like: victim, inflictor, attacker, damagetype, weaponent - to enrich API consumption
  • rename function to GetWeaponArmorRatio
  • change every magic number into a named constant, and write it to weapons.h
  • add an API-only behaviour that retrieves armorratio from a CCSPlayerWeapon member (and init their values in the constant ones), so coders can easily alter armor ratio based on entities

@justgo97
Copy link
Author

A few recommendations to make this even better:

  • add more parameters to the function, like: victim, inflictor, attacker, damagetype, weaponent - to enrich API consumption
  • rename function to GetWeaponArmorRatio
  • change every magic number into a named constant, and write it to weapons.h
  • add an API-only behaviour that retrieves armorratio from a CCSPlayerWeapon member (and init their values in the constant ones), so coders can easily alter armor ratio based on entities

Feel free to open another PR with those changes, I'm just doing small changes for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants