Merge pull request #3436 from acemod/register-last-damage-source

Add registering last damage source
This commit is contained in:
Thomas Kooi 2016-02-27 12:42:11 +01:00
commit a0ea724db4

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 {