Fix medical CPR code and log message

Performing CPR would never succeed when the patient was in revive state because the code was accidentally using `exitWith` instead of `then`. The log message string was also incorrect.
This commit is contained in:
SilentSpike 2015-08-19 23:30:13 +01:00
parent 3aab62fa7c
commit 33ef60266b
2 changed files with 7 additions and 4 deletions

View File

@ -18,20 +18,20 @@ private ["_caller","_target", "_reviveStartTime"];
_caller = _this select 0; _caller = _this select 0;
_target = _this select 1; _target = _this select 1;
if (_target getvariable [QGVAR(inReviveState), false]) exitwith { if (_target getvariable [QGVAR(inReviveState), false]) then {
_reviveStartTime = _target getvariable [QGVAR(reviveStartTime),0]; _reviveStartTime = _target getvariable [QGVAR(reviveStartTime),0];
if (_reviveStartTime > 0) then { if (_reviveStartTime > 0) then {
_target setvariable [QGVAR(reviveStartTime), (_reviveStartTime + random(20)) min ACE_time]; _target setvariable [QGVAR(reviveStartTime), (_reviveStartTime + random(20)) min ACE_time];
}; };
}; };
if (random(1)>= 0.6) exitwith { if ((random 1) >= 0.6) then {
_target setvariable [QGVAR(inCardiacArrest), nil,true]; _target setvariable [QGVAR(inCardiacArrest), nil,true];
_target setvariable [QGVAR(heartRate), 40]; _target setvariable [QGVAR(heartRate), 40];
_target setvariable [QGVAR(bloodPressure), [50,70]]; _target setvariable [QGVAR(bloodPressure), [50,70]];
}; };
[_target, "activity", LSTRING(Activity_fullHeal), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); [_target, "activity", LSTRING(Activity_CPR), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target, "activity_view", LSTRING(Activity_fullHeal), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message [_target, "activity_view", LSTRING(Activity_CPR), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
true; true;

View File

@ -2098,6 +2098,9 @@
<Portuguese>%1 aplicou um torniquete</Portuguese> <Portuguese>%1 aplicou um torniquete</Portuguese>
<Czech>%1 použil škrtidlo</Czech> <Czech>%1 použil škrtidlo</Czech>
</Key> </Key>
<Key ID="STR_ACE_Medical_Activity_CPR">
<English>%1 performed CPR</English>
</Key>
<Key ID="STR_ACE_Medical_HeavilyWounded"> <Key ID="STR_ACE_Medical_HeavilyWounded">
<English>Heavily wounded</English> <English>Heavily wounded</English>
<German>Schwer verwundet:</German> <German>Schwer verwundet:</German>