diff --git a/addons/medical/functions/fnc_addToLog.sqf b/addons/medical/functions/fnc_addToLog.sqf index db752396e5..c9d40ca071 100644 --- a/addons/medical/functions/fnc_addToLog.sqf +++ b/addons/medical/functions/fnc_addToLog.sqf @@ -48,3 +48,9 @@ _log pushback [_message,_moment,_type, _arguments]; _unit setvariable [_logVarName, _log, true]; ["medical_onLogEntryAdded", [_unit, _type, _message, _arguments]] call ace_common_fnc_localEvent; + +_logs = _unit getvariable [QGVAR(allLogs), []]; +if !(_logVarName in _logs) then { + _logs pushback _logVarName; + _unit setvariable [QGVAR(allLogs), _logs, true]; +}; diff --git a/addons/medical/functions/fnc_init.sqf b/addons/medical/functions/fnc_init.sqf index 514fa04691..7303242b65 100644 --- a/addons/medical/functions/fnc_init.sqf +++ b/addons/medical/functions/fnc_init.sqf @@ -13,7 +13,7 @@ #include "script_component.hpp" -private ["_unit"]; +private ["_unit", "_allUsedMedication", "_logs"]; _unit = _this select 0; @@ -67,3 +67,9 @@ _allUsedMedication = _target getVariable [QGVAR(allUsedMedication), []]; { _unit setvariable [_x select 0, nil]; }foreach _allUsedMedication; + +_logs = _unit getvariable [QGVAR(allLogs), []]; +{ + _unit setvariable [_x, nil, true]; +}foreach _logs; +_unit setvariable [QGVAR(allLogs), [], true];