-
Notifications
You must be signed in to change notification settings - Fork 1
Remove _modifiedRealDamage
#2
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
base: main
Are you sure you want to change the base?
Remove _modifiedRealDamage
#2
Conversation
johnb432
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this PR, armor that is being adjusted down in value will create a large _modifiedRealDamage, making it appear as if armor that absorbed more damage.
Why is that a bad thing?
| [_damageRightLeg select 0, PRIORITY_RIGHT_LEG, _damageRightLeg select 1, "RightLeg", _damageRightLeg param [2, _damageRightLeg select 0], _damageRightLeg param [3, _damageRightLeg select 1]], | ||
| [_damageStructural select 0, PRIORITY_STRUCTURAL, _damageStructural select 1, "#structural", _damageStructural param [2, _damageStructural select 0], _damageStructural param [3, _damageStructural select 1]] | ||
| // Real damage, Damage (with armor), Modified damage (with armor) | ||
| [_damageHead select 0, PRIORITY_HEAD, _damageHead select 1, "Head", _damageHead param [2, _damageHead select 1]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you fail to get _modifiedRealDamage from a body part, you are going to get _newDamage instead?
The reason I added the param is in case other mods decide to set the array length at 2, they would be overwriting the changes done by this mod. Using _newDamage makes no sense when _realDamage is available - it's better to have no effect than a weird side effect.
| case (_armorMin >= 1 && {_armor < _armorMin}): { | ||
| // This will decrease damage | ||
| _modifiedNewDamage = _newDamage * _armor / _armorMin; | ||
| _modifiedRealDamage = _realDamage * _armor / _armorMin; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why I added this is because there are instances where shooting e.g. at the torso would trigger damage on limbs. The problem was (can't reproduce it in 2.18) that the adjusted damage of the torso was lower than the damage done to the limbs, so the wounds would appear on the limbs and not the torso.
As said, I can't reproduce it anymore, but I'm not comfortable removing it just yet.
When merged, this PR will
_realDamage._realDamageis the calculated damage caused by a bullet (_newDamage = _bulletDamage/_armor), a number unrelated to the value of the "new" armor._modifiedRealDamage = _newDamage * _armor * _armor / _armor<Min/Max>_realDamagein place of the variableWithout this PR, armor that is being adjusted down in value will create a large
_modifiedRealDamage, making it appear as if armor that absorbed more damage.