mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fix some script errors on medical rewrite (#6450)
This commit is contained in:
parent
6497f6c9d4
commit
604fa0e4cb
@ -18,7 +18,7 @@
|
||||
params ["_unit"];
|
||||
|
||||
if (GVAR(useAceMedical)) exitWith {
|
||||
IS_BLEEDING(_unit)
|
||||
IS_BLEEDING(_unit);
|
||||
};
|
||||
|
||||
alive _unit && {getDammage _unit > 0.3}
|
||||
|
@ -113,7 +113,7 @@ _unit setVariable [QEGVAR(medical,bodyPartDamage), _bodyPartDamage, true];
|
||||
_bodyPartVisParams call EFUNC(medical_engine,updateBodyPartVisuals);
|
||||
|
||||
[_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 {
|
||||
[_unit] call FUNC(handleIncapacitation);
|
||||
|
@ -171,7 +171,7 @@ _unit setVariable [QEGVAR(medical,bodyPartDamage), _bodyPartDamage, true];
|
||||
_bodyPartVisParams call EFUNC(medical_engine,updateBodyPartVisuals);
|
||||
|
||||
[_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 {
|
||||
[_unit] call FUNC(handleIncapacitation);
|
||||
|
@ -1,11 +1,11 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
[QGVAR(medical,injured), {
|
||||
[QEGVAR(medical,injured), {
|
||||
params ["_unit", "_painLevel"];
|
||||
[_unit, "hit", PAIN_TO_SCREAM(_painLevel)] call FUNC(playInjuredSound);
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
[QGVAR(medical,moan), {
|
||||
[QEGVAR(medical,moan), {
|
||||
params ["_unit", "_painLevel"];
|
||||
[_unit, "moan", PAIN_TO_MOAN(_painLevel)] call FUNC(playInjuredSound);
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
@ -19,5 +19,5 @@ if (!local _unit) exitWith {
|
||||
|
||||
private _painLevel = GET_PAIN_PERCEIVED(_unit);
|
||||
if (_painLevel > 0) then {
|
||||
[QGVAR(medical,moan), [_unit, _painLevel]] call CBA_fnc_localEvent;
|
||||
[QEGVAR(medical,moan), [_unit, _painLevel]] call CBA_fnc_localEvent;
|
||||
};
|
||||
|
@ -17,6 +17,6 @@ if (!local _unit) exitWith {
|
||||
|
||||
private _painLevel = GET_PAIN_PERCEIVED(_unit);
|
||||
if (_painLevel > 0) then {
|
||||
[QGVAR(medical,moan), [_unit, _painLevel]] call CBA_fnc_localEvent;
|
||||
[QEGVAR(medical,moan), [_unit, _painLevel]] call CBA_fnc_localEvent;
|
||||
};
|
||||
|
||||
|
@ -18,7 +18,7 @@ if (!local _unit) exitWith {
|
||||
|
||||
private _painLevel = GET_PAIN_PERCEIVED(_unit);
|
||||
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
|
||||
|
@ -30,7 +30,7 @@ _unit setVariable [VAR_UNCON, _knockOut, true];
|
||||
|
||||
if (_knockOut) then {
|
||||
// --- 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]);
|
||||
TRACE_2("setting lastWakeUpCheck",_lastWakeUpCheck,(_lastWakeUpCheck - CBA_missiontime));
|
||||
_unit setVariable [QGVAR(lastWakeUpCheck), _lastWakeUpCheck];
|
||||
@ -43,7 +43,7 @@ if (_knockOut) then {
|
||||
closeDialog 0;
|
||||
};
|
||||
};
|
||||
[QGVAR(Unconscious), _unit] call CBA_fnc_localEvent;
|
||||
[QEGVAR(medical,Unconscious), _unit] call CBA_fnc_localEvent;
|
||||
} else {
|
||||
// --- wake up
|
||||
_unit setVariable [QGVAR(lastWakeUpCheck), nil]; // clear this now (min wait time could be set to a very high value)
|
||||
|
Loading…
Reference in New Issue
Block a user