Fix some script errors on medical rewrite (#6450)

This commit is contained in:
Thomas Kooi 2018-07-18 22:50:03 +02:00 committed by GitHub
parent 6497f6c9d4
commit 604fa0e4cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 10 additions and 10 deletions

View File

@ -18,7 +18,7 @@
params ["_unit"]; params ["_unit"];
if (GVAR(useAceMedical)) exitWith { if (GVAR(useAceMedical)) exitWith {
IS_BLEEDING(_unit) IS_BLEEDING(_unit);
}; };
alive _unit && {getDammage _unit > 0.3} alive _unit && {getDammage _unit > 0.3}

View File

@ -113,7 +113,7 @@ _unit setVariable [QEGVAR(medical,bodyPartDamage), _bodyPartDamage, true];
_bodyPartVisParams call EFUNC(medical_engine,updateBodyPartVisuals); _bodyPartVisParams call EFUNC(medical_engine,updateBodyPartVisuals);
[_unit, _painLevel] call EFUNC(medical,adjustPainLevel); [_unit, _painLevel] call EFUNC(medical,adjustPainLevel);
[QGVAR(medical,injured), [_unit, _painLevel]] call CBA_fnc_localEvent; [QEGVAR(medical,injured), [_unit, _painLevel]] call CBA_fnc_localEvent;
if (_critialDamage || {_painLevel > PAIN_UNCONSCIOUS}) then { if (_critialDamage || {_painLevel > PAIN_UNCONSCIOUS}) then {
[_unit] call FUNC(handleIncapacitation); [_unit] call FUNC(handleIncapacitation);

View File

@ -171,7 +171,7 @@ _unit setVariable [QEGVAR(medical,bodyPartDamage), _bodyPartDamage, true];
_bodyPartVisParams call EFUNC(medical_engine,updateBodyPartVisuals); _bodyPartVisParams call EFUNC(medical_engine,updateBodyPartVisuals);
[_unit, _painLevel] call EFUNC(medical,adjustPainLevel); [_unit, _painLevel] call EFUNC(medical,adjustPainLevel);
[QGVAR(medical,injured), [_unit, _painLevel]] call CBA_fnc_localEvent; [QEGVAR(medical,injured), [_unit, _painLevel]] call CBA_fnc_localEvent;
if (_critialDamage || {_painLevel > PAIN_UNCONSCIOUS}) then { if (_critialDamage || {_painLevel > PAIN_UNCONSCIOUS}) then {
[_unit] call FUNC(handleIncapacitation); [_unit] call FUNC(handleIncapacitation);

View File

@ -1,11 +1,11 @@
#include "script_component.hpp" #include "script_component.hpp"
[QGVAR(medical,injured), { [QEGVAR(medical,injured), {
params ["_unit", "_painLevel"]; params ["_unit", "_painLevel"];
[_unit, "hit", PAIN_TO_SCREAM(_painLevel)] call FUNC(playInjuredSound); [_unit, "hit", PAIN_TO_SCREAM(_painLevel)] call FUNC(playInjuredSound);
}] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler;
[QGVAR(medical,moan), { [QEGVAR(medical,moan), {
params ["_unit", "_painLevel"]; params ["_unit", "_painLevel"];
[_unit, "moan", PAIN_TO_MOAN(_painLevel)] call FUNC(playInjuredSound); [_unit, "moan", PAIN_TO_MOAN(_painLevel)] call FUNC(playInjuredSound);
}] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler;

View File

@ -19,5 +19,5 @@ if (!local _unit) exitWith {
private _painLevel = GET_PAIN_PERCEIVED(_unit); private _painLevel = GET_PAIN_PERCEIVED(_unit);
if (_painLevel > 0) then { if (_painLevel > 0) then {
[QGVAR(medical,moan), [_unit, _painLevel]] call CBA_fnc_localEvent; [QEGVAR(medical,moan), [_unit, _painLevel]] call CBA_fnc_localEvent;
}; };

View File

@ -17,6 +17,6 @@ if (!local _unit) exitWith {
private _painLevel = GET_PAIN_PERCEIVED(_unit); private _painLevel = GET_PAIN_PERCEIVED(_unit);
if (_painLevel > 0) then { if (_painLevel > 0) then {
[QGVAR(medical,moan), [_unit, _painLevel]] call CBA_fnc_localEvent; [QEGVAR(medical,moan), [_unit, _painLevel]] call CBA_fnc_localEvent;
}; };

View File

@ -18,7 +18,7 @@ if (!local _unit) exitWith {
private _painLevel = GET_PAIN_PERCEIVED(_unit); private _painLevel = GET_PAIN_PERCEIVED(_unit);
if (_painLevel > 0) then { if (_painLevel > 0) then {
[QGVAR(medical,moan), [_unit, _painLevel]] call CBA_fnc_localEvent; [QEGVAR(medical,moan), [_unit, _painLevel]] call CBA_fnc_localEvent;
}; };
// Handle spontaneous wakeup from unconsciousness // Handle spontaneous wakeup from unconsciousness

View File

@ -30,7 +30,7 @@ _unit setVariable [VAR_UNCON, _knockOut, true];
if (_knockOut) then { if (_knockOut) then {
// --- knock out // --- knock out
if (GVAR(spontaneousWakeUpChance) > 0) then { // Don't bother setting this if not used if (EGVAR(medical,spontaneousWakeUpChance) > 0) then { // Don't bother setting this if not used
private _lastWakeUpCheck = CBA_missiontime max (_unit getVariable [QGVAR(lastWakeUpCheck), 0]); private _lastWakeUpCheck = CBA_missiontime max (_unit getVariable [QGVAR(lastWakeUpCheck), 0]);
TRACE_2("setting lastWakeUpCheck",_lastWakeUpCheck,(_lastWakeUpCheck - CBA_missiontime)); TRACE_2("setting lastWakeUpCheck",_lastWakeUpCheck,(_lastWakeUpCheck - CBA_missiontime));
_unit setVariable [QGVAR(lastWakeUpCheck), _lastWakeUpCheck]; _unit setVariable [QGVAR(lastWakeUpCheck), _lastWakeUpCheck];
@ -43,7 +43,7 @@ if (_knockOut) then {
closeDialog 0; closeDialog 0;
}; };
}; };
[QGVAR(Unconscious), _unit] call CBA_fnc_localEvent; [QEGVAR(medical,Unconscious), _unit] call CBA_fnc_localEvent;
} else { } else {
// --- wake up // --- wake up
_unit setVariable [QGVAR(lastWakeUpCheck), nil]; // clear this now (min wait time could be set to a very high value) _unit setVariable [QGVAR(lastWakeUpCheck), nil]; // clear this now (min wait time could be set to a very high value)