mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Medical - Skip unneeded setVars on initUnit (#6949)
This commit is contained in:
parent
6d1eb914c4
commit
a23b22aef6
@ -19,8 +19,7 @@ class Extended_PostInit_EventHandlers {
|
||||
class Extended_Init_EventHandlers {
|
||||
class CAManBase {
|
||||
class ADDON {
|
||||
onRespawn = 1;
|
||||
init = QUOTE(call FUNC(initUnit));
|
||||
init = QUOTE([ARR_2((_this select 0), false)] call FUNC(initUnit));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -5,17 +5,22 @@
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The Unit <OBJECT>
|
||||
* 1: Is Respawned <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [bob] call ace_medical_status_fnc_init
|
||||
* [bob, false] call ace_medical_status_fnc_initUnit
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_unit"];
|
||||
params ["_unit", ["_isRespawn", true]];
|
||||
|
||||
if (!_isRespawn) then { // Always add respawn EH (same as CBA's onRespawn=1)
|
||||
_unit addEventHandler ["Respawn", {[(_this select 0), true] call FUNC(initUnit)}];
|
||||
};
|
||||
|
||||
if (!local _unit) exitWith {};
|
||||
|
||||
@ -23,6 +28,8 @@ if (damage _unit > 0) then {
|
||||
_unit setDamage 0;
|
||||
};
|
||||
|
||||
if (_isRespawn) then {
|
||||
TRACE_1("reseting all vars on respawn",_isRespawn); // note: state is handled by ace_medical_statemachine_fnc_resetStateDefault
|
||||
// - Blood and heart ----------------------------------------------------------
|
||||
_unit setVariable [VAR_BLOOD_VOL, DEFAULT_BLOOD_VOLUME, true];
|
||||
_unit setVariable [VAR_HEART_RATE, DEFAULT_HEART_RATE, true];
|
||||
@ -59,9 +66,6 @@ _unit setVariable [QEGVAR(medical,triageCard), [], true];
|
||||
|
||||
// damage storage
|
||||
_unit setVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0], true];
|
||||
#ifdef DEBUG_TESTRESULTS
|
||||
_unit setVariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0], true];
|
||||
#endif
|
||||
|
||||
// medication
|
||||
_unit setVariable [VAR_MEDICATIONS, [], true];
|
||||
@ -72,6 +76,7 @@ private _logs = _unit getVariable [QEGVAR(medical,allLogs), []];
|
||||
_unit setVariable [_x, nil];
|
||||
} forEach _logs;
|
||||
_unit setVariable [QEGVAR(medical,allLogs), [], true];
|
||||
};
|
||||
|
||||
[{
|
||||
params ["_unit"];
|
||||
|
@ -57,9 +57,6 @@ _target setVariable [QEGVAR(medical,ivBags), nil, true];
|
||||
|
||||
// damage storage
|
||||
_target setVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0], true];
|
||||
#ifdef DEBUG_TESTRESULTS
|
||||
_target setVariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0], true];
|
||||
#endif
|
||||
|
||||
// generic medical admin
|
||||
_target setVariable [VAR_CRDC_ARRST, false, true];
|
||||
|
Loading…
Reference in New Issue
Block a user