mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
We already determine the new damage in caching, so we will use that value instead of recalculating it here
This commit is contained in:
parent
e8d2a00994
commit
6cc115a628
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user