ACE3/addons/common/functions/fnc_resetAllDefaults.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

39 lines
829 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: Glowbal
* reset all variables that have been defined
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* ? <UNKNOWN>
*
* Example:
* [bob] call ace_common_fnc_resetAllDefaults
*
* Public: No
*/
params ["_unit"];
_unit setVariable ["ACE_isDead", nil, true];
_unit setVariable ["ACE_isUnconscious", nil, true];
if (isPlayer _unit) then {
[true] call FUNC(setVolume);
if (!isNil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then {
// clear all disable user input
{
[_x, false] call FUNC(setDisableUserInputStatus);
} forEach GVAR(DISABLE_USER_INPUT_COLLECTION);
};
};
{
if !(_x select 4) then {
_unit setVariable [_x select 0, nil, _x select 3];
};
} forEach ([_unit] call FUNC(getAllDefinedSetVariables));