We already determine the new damage in caching, so we will use that value instead of recalculating it here

This commit is contained in:
Glowbal 2015-04-11 22:31:17 +02:00
parent e8d2a00994
commit 6cc115a628

View File

@ -25,21 +25,21 @@ _selectionName = _this select 1;
_amountOfDamage = _this select 2;
_sourceOfDamage = _this select 3;
_typeOfProjectile = _this select 4;
_newDamage = _this select 5;
// Most likely taking exessive fire damage. Lets exit.
if (isNull _sourceOfDamage && (_selectionName == "head" || isBurning _unit) && _typeOfProjectile == "" && vehicle _unit == _unit) exitwith {
if (isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) exitwith {
0
};
_typeOfDamage = [_typeOfProjectile] call FUNC(getTypeOfDamage);
_part = [_selectionName] call FUNC(selectionNameToNumber);
_hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"];
// Sorting out the damage
_damageBodyParts = _unit getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]];
_newDamage = _amountOfDamage - (_unit getHitPointDamage (_hitPoints select _part));
_damageBodyParts set [_part, (_damageBodyParts select _part) + _newDamage];
_unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true];
[_unit] call FUNC(handleDamage_advancedSetDamage);
[_unit, _selectionName, _newDamage, _typeOfProjectile, _typeOfDamage] call FUNC(handleDamage_wounds);