fixed basic revive 2

This commit is contained in:
Glowbal 2015-04-04 16:28:09 +02:00
parent 18900cb82c
commit b54179696a
2 changed files with 10 additions and 7 deletions

View File

@ -26,7 +26,7 @@ if (!local _unit) exitwith {
false;
};
if ((_unit getVariable [QGVAR(preventDeath), GVAR(preventInstaDeath)]) && !_force) exitwith {
if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) && !_force) exitwith {
if (_unit getvariable [QGVAR(inReviveState), false]) exitwith {
if (GVAR(amountOfReviveLives) > 0) then {
_lifesLeft = _unit getvariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)];
@ -52,7 +52,6 @@ if ((_unit getVariable [QGVAR(preventDeath), GVAR(preventInstaDeath)]) && !_forc
[(_this select 1)] call cba_fnc_removePerFrameHandler;
_unit setvariable [QGVAR(inReviveState), nil, true];
_unit setvariable [QGVAR(reviveStartTime), nil];
[_unit, true] call FUNC(setDead);
};

View File

@ -29,7 +29,7 @@ _damage = _this select 2;
// Unit isn't local, give function to machine where it is.
if !(local _unit) exitWith {
[_this, "ace_medical_fnc_setHitPointDamage", _unit] call EFUNC(common,execRemoteFnc);
[_this, QUOTE(DFUNC(setHitPointDamage)), _unit] call EFUNC(common,execRemoteFnc);
};
// Check if overall damage adjustment is disabled
@ -72,9 +72,13 @@ if (_damageOld > 0) then {
_damageNew = _damageOld * (_damageSumNew / _damageSumOld);
};
// @todo: prevent death
_unit setDamage _damageNew;
// prevent death
if (_damageNew >= 0.9) then {
_unit setDamage 0.9;
[_unit] call FUNC(setDead);
} else {
_unit setDamage _damageNew;
};
{
_damageFinal = (_damages select _forEachIndex);
@ -88,7 +92,7 @@ if (_legdamage >= LEGDAMAGETRESHOLD1) then {
} else {
if (_unit getHitPointDamage "HitLegs" != 0) then {_unit setHitPointDamage ["HitLegs", 0]};
};
// @ŧodo: force prone for completely fucked up legs.
// @todo: force prone for completely fucked up legs.
// Arm Damage