Add registering last damage source

This commit is contained in:
Glowbal 2016-02-26 22:58:49 +01:00
parent 7646068a8b
commit e0a65aa543

View File

@ -77,6 +77,10 @@ _minLethalDamage = if (_typeIndex >= 0) then {
0.01
};
if (!isNull _shooter) then {
_unit setvariable [QGVAR(lastDamageSource), _shooter, false];
};
private _vehicle = vehicle _unit;
private _effectiveSelectionName = _selection;
if ((_vehicle != _unit) && {!(_vehicle isKindOf "StaticWeapon")} && {_shooter in [objNull, driver _vehicle, _vehicle]} && {_projectile == ""} && {_selection == ""}) then {
@ -98,6 +102,7 @@ if ((_minLethalDamage <= _newDamage) && {[_unit, [_effectiveSelectionName] call
_damageReturn = _damageReturn min 0.89;
};
[_unit] call FUNC(addToInjuredCollection);
if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitWith {