Move medical logs clearing to treatment

This commit is contained in:
mharis001
2019-04-26 15:54:36 -04:00
parent e57a6fbb13
commit 9fa0b8bea1
2 changed files with 15 additions and 10 deletions

View File

@ -63,15 +63,8 @@ _unit setVariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0], true];
// medication
_unit setVariable [VAR_MEDICATIONS, [], true];
// TODO move to treatment
private _logs = _unit getVariable [QEGVAR(medical,allLogs), []];
{
_unit setVariable [_x, nil];
} forEach _logs;
_unit setVariable [QEGVAR(medical,allLogs), [], true];
[{
params ["_unit"];
TRACE_2("Unit Init",_unit,local _unit);
[QGVAR(initialized), [_unit]] call CBA_fnc_localEvent;
}, [_unit], 0.5] call CBA_fnc_waitAndExecute;
[QGVAR(initialized), _unit] call CBA_fnc_localEvent;
}, _unit, 0.5] call CBA_fnc_waitAndExecute;

View File

@ -1,6 +1,18 @@
#include "script_component.hpp"
[QEGVAR(medical_status,initialized), FUNC(checkItems)] call CBA_fnc_addEventHandler;
[QEGVAR(medical_status,initialized), {
params ["_unit"];
// Clear all saved medical logs
{
_unit setVariable [_x, nil, true];
} forEach (_unit getVariable [QEGVAR(medical,allLogs), []]);
_unit setVariable [QEGVAR(medical,allLogs), [], true];
[_unit] call FUNC(checkItems);
}] call CBA_fnc_addEventHandler;
["loadout", FUNC(checkItems)] call CBA_fnc_addPlayerEventHandler;
// Handle bodybags and litter on server