From 6d01a00901fe6a520e0575f5b13fbd80481592f3 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 28 Feb 2015 11:47:35 +0100 Subject: [PATCH] Added storage for all logs --- addons/medical/functions/fnc_addToLog.sqf | 6 ++++++ addons/medical/functions/fnc_init.sqf | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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];