ACE3/TO_MERGE/cse/main/variables/functions/fn_setVariable.sqf

29 lines
732 B
Plaintext
Raw Normal View History

2015-01-12 22:35:40 +00:00
/**
* fn_setVariable.sqf
* @Descr: Setvariable value
* @Author: Glowbal
*
* @Arguments: [unit OBJECT, variableName STRING, value ANY]
* @Return: void
* @PublicAPI: true
*/
private ["_unit","_variable","_value","_update","_global","_definedVariable","_defaultGlobal","_currentValue"];
_unit = _this select 0;
_variable = _this select 1;
_value = _this select 2;
_global = false;
if (count _this > 3) then {
_global = _this select 3;
} else {
_definedVariable = ([_variable] call cse_fnc_getVariableInfo);
if (count _definedVariable > 2) then {
_global = _definedVariable select 2;
};
};
if (!isNil "_value") exitwith {
_unit setvariable [_variable, _value, _global];
};
_unit setvariable [_variable, nil, _global];