Fix debug message and prevent Instant death inside vehicles

This commit is contained in:
Glowbal 2015-05-18 22:22:57 +02:00
parent 4bd34c64bf
commit 539ed2dc79

View File

@ -66,7 +66,7 @@ if (GVAR(level) < 2) then {
};
};
if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)} || !alive vehicle _unit) then {
if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)}) then {
if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)])) exitwith {
_damageReturn = 0.9;
};
@ -83,19 +83,27 @@ if (GVAR(level) < 2) then {
if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitWith {
private "_delayedUnconsicous";
_delayedUnconsicous = false;
if (vehicle _unit != _unit and {damage (vehicle _unit) >= 1}) then {
[_unit] call EFUNC(common,unloadPerson);
_delayedUnconsicous = true;
};
if (_damageReturn >= 0.9 && {_selection in ["", "head", "body"]}) exitWith {
systemChat format["Lethal damage %1 ", _unit];
if (_unit getvariable ["ACE_isUnconscious", false]) exitwith {
[_unit] call FUNC(setDead);
0.89
};
[{
[_this select 0, true] call FUNC(setUnconscious);
}, [_unit]] call EFUNC(common,execNextFrame);
if (_delayedUnconsicous) then {
[{
[_this select 0, true] call FUNC(setUnconscious);
}, [_unit], 0.7, 0] call EFUNC(common,waitAndExec);
} else {
[{
[_this select 0, true] call FUNC(setUnconscious);
}, [_unit]] call EFUNC(common,execNextFrame);
};
0.89
};
_damageReturn min 0.89;