ACE3/addons/common/functions/fnc_restoreVariablesJIP.sqf
johnb432 8f46ffd8d5
General - Change count to forEach where appropriate (#9890)
count -> forEach

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
2024-04-04 08:15:26 -03:00

28 lines
583 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: commy2
* Called from respawn eventhandler. Resets all public object namespace variables that are added via FUNC(setVariableJIP).
*
* Arguments:
* 0: Object <OBJECT>
*
* Return Value:
* None
*
* Example:
* [bob] call ace_common_fnc_restoreVariablesJIP
*
* Public: No
*/
params ["_unit"];
private _respawnVariables = _unit getVariable ["ACE_respawnVariables", []];
// yes those
_respawnVariables pushBack "ACE_PersistentFunctions";
{
_unit setVariable [_x, _unit getVariable _x, true];
} forEach _respawnVariables;