mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
fix in setsettings
This commit is contained in:
parent
74d0ae95ff
commit
b119d5246b
@ -36,13 +36,22 @@ if (count _settingData == 0) exitWith {};
|
|||||||
if (_settingData select 6) exitWith {};
|
if (_settingData select 6) exitWith {};
|
||||||
|
|
||||||
// If the type is not equal, try to cast it
|
// If the type is not equal, try to cast it
|
||||||
|
_failed = false;
|
||||||
if ((typeName _value) != (_settingData select 1)) then {
|
if ((typeName _value) != (_settingData select 1)) then {
|
||||||
_failed = True;
|
_failed = true;
|
||||||
if ((_settingData select 1) == "BOOL" and (typeName _value) == "SCALAR") exitWith {
|
diag_log (typeName _value);
|
||||||
_value = _value > 0;
|
if ((_settingData select 1) == "BOOL" and (typeName _value) == "SCALAR") then {
|
||||||
_failed = false;
|
// If value is not 0 or 1 consider it invalid and don't set anything
|
||||||
|
if (_value == 0) then {
|
||||||
|
_value = false;
|
||||||
|
_failed = false;
|
||||||
|
};
|
||||||
|
if (_value == 1) then {
|
||||||
|
_value = true;
|
||||||
|
_failed = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
if ((_settingData select 1) == "COLOR" and (typeName _value) == "ARRAY") exitWith {
|
if ((_settingData select 1) == "COLOR" and (typeName _value) == "ARRAY") then {
|
||||||
_failed = false;
|
_failed = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user