ACE3/addons/common/functions/fnc_restoreVariablesJIP.sqf

26 lines
542 B
Plaintext
Raw Normal View History

/*
* Author: commy2
*
2015-01-11 18:20:14 +00:00
* Called from respawn eventhandler. Resets all public object namespace variables that are added via FUNC(setVariableJIP).
*
* Argument:
* 0: Object (Object)
*
* Return value:
* Nothing.
*/
2015-01-13 19:56:02 +00:00
#include "script_component.hpp"
private ["_unit", "_respawnVariables"];
_unit = _this select 0;
_respawnVariables = _unit getVariable ["ACE_respawnVariables", []];
// yes those
_respawnVariables pushBack "ACE_PersistentFunctions";
{
_unit setVariable [_x, _unit getVariable _x, true];
} forEach _respawnVariables;