mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
ACE_Settings: setSettings tab to space, casting
This commit is contained in:
parent
051ad00806
commit
66045b8d51
@ -35,8 +35,18 @@ if (count _settingData == 0) exitWith {};
|
||||
// Exit if the setting is already forced
|
||||
if (_settingData select 6) exitWith {};
|
||||
|
||||
// Exit if the type is not right
|
||||
if ((typeName _value) != typeName (missionNamespace getVariable _name)) exitWith {};
|
||||
// If the type is not equal, try to cast it
|
||||
if ((typeName _value) != (_settingData select 1)) then {
|
||||
_failed = True;
|
||||
if ((_settingData select 1) == "BOOL" and (typeName _value) == "SCALAR") exitWith {
|
||||
_value = _value > 0;
|
||||
_failed = false;
|
||||
};
|
||||
if ((_settingData select 1) == "COLOR" and (typeName _value) == "ARRAY") exitWith {
|
||||
_failed = false;
|
||||
};
|
||||
};
|
||||
if (_failed) exitWith {};
|
||||
|
||||
// Force it if it was required
|
||||
_settingData set [6, _force];
|
||||
|
Loading…
Reference in New Issue
Block a user