1.54 - Replace typeName with isEqualType

This commit is contained in:
PabstMirror 2015-11-20 11:40:31 -06:00
parent dd7c71eeee
commit 69b53af1d3
66 changed files with 101 additions and 101 deletions

View File

@ -14,7 +14,7 @@
params ["_backpack"];
if (typeName _backpack == "OBJECT") then {
if (_backpack isEqualType objNull) then {
_backpack = typeOf _backpack;
};

View File

@ -27,7 +27,7 @@
_unloaded = [_item, _vehicle] call FUNC(unloadItem);
_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item};
_itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
// Show hint as feedback
_hint = [LSTRING(UnloadingFailed), LSTRING(UnloadedItem)] select _unloaded;

View File

@ -23,7 +23,7 @@ if (speed _vehicle > 1 || (((getPos _vehicle) select 2) > 3)) exitWith {false};
private ["_itemSize", "_validItem"];
_itemSize = [_item] call FUNC(getSizeItem);
if (typeName _item == "STRING") then {
if (_item isEqualType "") then {
_validItem =
isClass (configFile >> "CfgVehicles" >> _item) &&
{getNumber (configFile >> "CfgVehicles" >> _item >> QGVAR(canLoad)) == 1};

View File

@ -22,7 +22,7 @@ private ["_loaded", "_itemClass", "_validVehiclestate", "_emptyPos"];
_loaded = _vehicle getVariable [QGVAR(loaded), []];
if !(_item in _loaded) exitWith {false};
_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item};
_itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
_validVehiclestate = true;
_emptyPos = [];

View File

@ -19,7 +19,7 @@ params ["_item"];
private ["_isVirtual","_itemClass","_config"];
scopeName "return";
_isVirtual = (typeName _item == "STRING");
_isVirtual = (_item isEqualType "");
_itemClass = if (_isVirtual) then {_item} else {typeOf _item};
_config = (configFile >> "CfgVehicles" >> _itemClass >> QGVAR(size));

View File

@ -24,7 +24,7 @@ if (_loaded isEqualTo []) exitWith {};
{
// TODO Do we want to be able to recover destroyed equipment?
if (typeName _x == "OBJECT") then {
if (_x isEqualType objNull) then {
deleteVehicle _x;
};
} count _loaded;

View File

@ -33,7 +33,7 @@ _space = [_vehicle] call FUNC(getCargoSpaceLeft);
_itemSize = [_item] call FUNC(getSizeItem);
_vehicle setVariable [QGVAR(space), _space - _itemSize, true];
if (typeName _item == "OBJECT") then {
if (_item isEqualType objNull) then {
detach _item;
_item attachTo [_vehicle,[0,0,-100]];
["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent);

View File

@ -40,7 +40,7 @@ uiNamespace setVariable [QGVAR(menuDisplay), _display];
lbClear _ctrl;
{
_class = if (typeName _x == "STRING") then {_x} else {typeOf _x};
_class = if (_x isEqualType "") then {_x} else {typeOf _x};
_ctrl lbAdd (getText(configfile >> "CfgVehicles" >> _class >> "displayName"));
true
} count _loaded;

View File

@ -41,7 +41,7 @@ if ([_item, GVAR(interactionVehicle)] call FUNC(canUnloadItem)) then {
[5 * _size, [_item, GVAR(interactionVehicle)], "UnloadCargo", {}, localize LSTRING(UnloadingItem)] call EFUNC(common,progressBar);
} else {
_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item};
_itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
_displayName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName");
["displayTextStructured", [[LSTRING(UnloadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent);

View File

@ -23,7 +23,7 @@ if !([_item, _vehicle] call FUNC(canUnloadItem)) exitWith {
false
};
_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item};
_itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
_validVehiclestate = true;
_emptyPos = [];
@ -57,7 +57,7 @@ _space = [_vehicle] call FUNC(getCargoSpaceLeft);
_itemSize = [_item] call FUNC(getSizeItem);
_vehicle setVariable [QGVAR(space), (_space + _itemSize), true];
if (typeName _item == "OBJECT") then {
if (_item isEqualType objNull) then {
detach _item;
_item setPosASL (_emptyPos call EFUNC(common,PositiontoASL));
["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent);

View File

@ -24,7 +24,7 @@ _loaded = _vehicle getVariable [QGVAR(loaded), []];
_newLoaded = [];
_totalSpaceOccupied = 0;
{
if ((typeName _x == "STRING") || {!isNull _x}) then {
if ((_x isEqualType "") || {!isNull _x}) then {
_newLoaded pushback _x;
_totalSpaceOccupied = _totalSpaceOccupied + ([_x] call FUNC(getSizeItem));
};

View File

@ -17,11 +17,11 @@
params ["_unit", "_action", "_condition", "_statement"];
if (typeName _condition == "STRING") then {
if (_condition isEqualType "") then {
_condition = compile _condition;
};
if (typeName _statement == "STRING") then {
if (_statement isEqualType "") then {
_statement = compile _statement;
};

View File

@ -21,19 +21,19 @@
params ["_unit", "_displayName", "_action", "_condition", "_statement", "_condition2", "_statement2", ["_priority", 0]];
if (typeName _condition == "STRING") then {
if (_condition isEqualType "") then {
_condition = compile _condition;
};
if (typeName _statement == "STRING") then {
if (_statement isEqualType "") then {
_statement = compile _statement;
};
if (typeName _condition2 == "STRING") then {
if (_condition2 isEqualType "") then {
_condition2 = compile _condition2;
};
if (typeName _statement2 == "STRING") then {
if (_statement2 isEqualType "") then {
_statement2 = compile _statement2;
};

View File

@ -14,7 +14,7 @@
params ["_statement"];
if (typeName _statement == "STRING") then {
if (_statement isEqualType "") then {
_statement = compile _statement;
};

View File

@ -15,7 +15,7 @@
params ["_statement"];
if (typeName _statement == "STRING") then {
if (_statement isEqualType "") then {
_statement = compile _statement;
};

View File

@ -22,14 +22,14 @@
params ["_list", "_variable", "_setting", "_global", ["_vehicle", false]];
if (typeName _list == "STRING") then {
if (_list isEqualType "") then {
_list = [_list, true, true] call FUNC(parseList);
TRACE_1("Parsed",_list)
};
{
if (!isNil "_x") then {
if (typeName _x == typeName objNull) then {
if (_x isEqualType objNull) then {
if (local _x) then {
if (_vehicle) then {
(vehicle _x) setVariable [_variable, _setting, _global];

View File

@ -16,7 +16,7 @@ if (!hasInterface) exitWith {};
params ["_id", ["_show", false]];
if (typeName _show == "SCALAR") then {
if (_show isEqualType 0) then {
_show = _show == 1;
};

View File

@ -14,7 +14,7 @@
params ["_function"];
if (typeName _function == "STRING") exitWith {_function};
if (_function isEqualType "") exitWith {_function};
_function = toArray str _function;
_function deleteAt 0;

View File

@ -21,7 +21,7 @@ params ["_name", "_value", "_defaultGlobal", "_category", ["_code", 0], ["_persi
if (isNil "_defaultGlobal") exitWith {};
if (typeName _name != "STRING") exitwith {
if (!(_name isEqualType "")) exitwith {
[format ["Tried to the deinfe a variable with an invalid name: %1 Arguments: %2", _name, _this]] call FUNC(debug);
};

View File

@ -22,7 +22,7 @@ private ["_validIndex", "_realIndex"];
_validIndex = -1;
if (typeName _searchOffsetOrName == "STRING") then {
if (_searchOffsetOrName isEqualType "") then {
{
if (_x select 0 == _searchOffsetOrName) exitWith {
_validIndex = _forEachIndex;

View File

@ -20,10 +20,10 @@ params ["_text", "_image", ["_imageColor", [1,1,1]], ["_target", ACE_player]];
if (_target != ACE_player) exitWith {};
if (typeName _text != "TEXT") then {
if (typeName _text == "ARRAY") then {
if (_text isEqualType []) then {
if (count _text > 0) then {
{
if (typeName _x == "STRING" && {isLocalized _x}) then {
if (_x isEqualType "" && {isLocalized _x}) then {
_text set [_forEachIndex, localize _x];
};
} forEach _text;
@ -32,7 +32,7 @@ if (typeName _text != "TEXT") then {
};
};
if (typeName _text == "STRING" && {isLocalized _text}) then {
if (_text isEqualType "" && {isLocalized _text}) then {
_text = localize _text;
};

View File

@ -19,17 +19,17 @@ params ["_text", ["_size", 1.5], ["_target", ACE_player]];
if (_target != ACE_player) exitWith {};
if (typeName _text != "TEXT") then {
if (typeName _text == "ARRAY") then {
if (_text isEqualType []) then {
if (count _text > 0) then {
{
if (typeName _x == "STRING" && {isLocalized _x}) then {
if (_x isEqualType "" && {isLocalized _x}) then {
_text set [_foreachIndex, localize _x];
};
}foreach _text;
_text = format _text;
};
};
if (typeName _text == "STRING" && {isLocalized _text}) then {
if (_text isEqualType "" && {isLocalized _text}) then {
_text = localize _text;
};
_text = composeText [lineBreak, parseText format ["<t align='center'>%1</t>", _text]];

View File

@ -31,7 +31,7 @@ if (isNull (call BIS_fnc_displayMission)) exitWith {
params ["_textHeader", "_textMessage", ["_onOK", {}], ["_onCancel", {}]];
if (typeName _textMessage == "STRING") then {
if (_textMessage isEqualType "") then {
_textMessage = parseText _textMessage;
};

View File

@ -27,7 +27,7 @@ TRACE_3("params", _arguments, _function, _unit);
_function = call compile _function;
if (typeName _unit == "SCALAR") exitWith {
if (_unit isEqualType 0) exitWith {
switch (_unit) do {
case 0 : {
_arguments call _function;

View File

@ -18,7 +18,7 @@ params ["_target"];
if (isNil "_x") then {
ACE_LOGERROR_1("No arguments and function for remote function. ID: %1",_forEachIndex);
} else {
if (typeName _x == "ARRAY") then {
if (_x isEqualType []) then {
[_x select 0, _target] call (_x select 1);
};
};

View File

@ -41,8 +41,8 @@ _fnc_logEntries = {
case (isClass _e1): {[_e1, _d + 1] call _fnc_logEntries; false};
};
if (typeName _e2 != "BOOL") then {
if (typeName _e2 == "ARRAY") then {
if (!(_e2 isEqualType false)) then {
if (_e2 isEqualType []) then {
_e2 = toArray str _e2;
{
if (_x == toArray "[" select 0) then {

View File

@ -27,7 +27,7 @@
// If the setting is stored on the profile
if !(isNil "_profileValue") then {
// If the profile variable has the correct type
if (typeName _profileValue == typeName (missionNamespace getVariable _name)) then {
if (_profileValue isEqualType (missionNamespace getVariable _name)) then {
// Load the setting from the profile
missionNamespace setVariable [_name, _profileValue];
};

View File

@ -30,7 +30,7 @@ _fnc_parseConfigForDisplayNames = {
private "_text";
_text = _x;
if (typeName _text == "STRING" && {count _text > 1} && {_text select [0, 1] == "$"}) then {
if (_text isEqualType "" && {count _text > 1} && {_text select [0, 1] == "$"}) then {
_text = localize (_text select [1]); //chop off the leading $
_values set [_forEachIndex, _text];
};

View File

@ -85,13 +85,13 @@ _fnc_perFrameFunction = {
[_this select 1] call CBA_fnc_removePerFrameHandler;
if (_errorCode == 0) then {
if (typeName _onFinish == "STRING") then {
if (_onFinish isEqualType "") then {
[_onFinish, [_args, _elapsedTime, _totalTime, _errorCode]] call FUNC(localEvent);
} else {
[_args, _elapsedTime, _totalTime, _errorCode] call _onFinish;
};
} else {
if (typeName _onFail == "STRING") then {
if (_onFail isEqualType "") then {
[_onFail, [_args, _elapsedTime, _totalTime, _errorCode]] call FUNC(localEvent);
} else {
[_args, _elapsedTime, _totalTime, _errorCode] call _onFail;

View File

@ -19,7 +19,7 @@ params ["_name", "_value"];
// Hack to keep backward compatibility for the moment
if (typeName (missionNamespace getVariable _name) == "BOOL") then {
if (typeName _value == "SCALAR") then {
if (_value isEqualType 0) then {
_value = _value > 0;
};
};

View File

@ -33,7 +33,7 @@ if (_settingData select 6) exitWith {};
_failed = false;
if (typeName _value != _settingData select 1) then {
_failed = true;
if (_settingData select 1 == "BOOL" && typeName _value == "SCALAR") then {
if (_settingData select 1 == "BOOL" && _value isEqualType 0) then {
// If value is not 0 or 1 consider it invalid and don't set anything
if (_value isEqualTo 0) then {
_value = false;
@ -44,7 +44,7 @@ if (typeName _value != _settingData select 1) then {
_failed = false;
};
};
if (_settingData select 1 == "COLOR" && typeName _value == "ARRAY") then {
if (_settingData select 1 == "COLOR" && _value isEqualType []) then {
_failed = false;
};
};

View File

@ -35,7 +35,7 @@ if (!isServer) exitWith {false};
_eventEntry = _x;
_ttlReturn = true;
if (typeName _globalEventTTL == "CODE") then {
if (_globalEventTTL isEqualType {}) then {
_ttlReturn = [_eventTime, _eventEntry] call _globalEventTTL;
} else {
_ttlReturn = call {_globalEventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _globalEventTTL}};
@ -45,7 +45,7 @@ if (!isServer) exitWith {false};
// Do event based TTL check
_eventEntry params ["_time", "", "_eventTTL"];
if (typeName _eventTTL == "CODE") then {
if (_eventTTL isEqualType {}) then {
_ttlReturn = [_eventTime, _eventEntry] call _eventTTL;
} else {
_ttlReturn = call {_eventTTL < 1 || {ACE_diagTime < _time + _eventTTL}};

View File

@ -17,6 +17,6 @@
params ["_value"];
if (typeName _value == "SCALAR") exitWith {_value};
if (_value isEqualType 0) exitWith {_value};
parseNumber _value // return

View File

@ -17,7 +17,7 @@ params ["_target"];
private ["_objectType","_actionsVarName","_isMan"];
_objectType = _target;
_isMan = false;
if (typeName _target == "OBJECT") then {
if (_target isEqualType objNull) then {
_objectType = typeOf _target;
_isMan = _target isKindOf "CAManBase";
};

View File

@ -17,7 +17,7 @@ params ["_target"];
private ["_objectType","_actionsVarName","_isMan"];
_objectType = _target;
_isMan = false;
if (typeName _target == "OBJECT") then {
if (_target isEqualType objNull) then {
_objectType = typeOf _target;
_isMan = _target isKindOf "CAManBase";
};

View File

@ -92,10 +92,10 @@ if (GVAR(openedMenuType) >= 0) then {
private "_runOnHover";
_tmp = ((GVAR(selectedAction) select 0) select 9) select 3;
_runOnHover = true;
if ((typeName _tmp) == "CODE" ) then {
if (_tmp isEqualType {}) then {
_runOnHover = call _tmp;
} else {
if ((typeName _tmp) == "BOOL" ) then {
if (_tmp isEqualType false) then {
_runOnHover = _tmp;
} else {
_runOnHover = _tmp > 0;

View File

@ -20,11 +20,11 @@ scopeName "main";
params ["_colorArray"];
if (isNil "_colorArray") exitWith {false};
if ((typeName _colorArray) != "ARRAY") exitWith {false};
if (!(_colorArray isEqualType [])) exitWith {false};
if (count _colorArray != 4) exitWith {false};
{
if ((typeName _x) != "SCALAR" || _x < 0 || _x > 1) exitWith {false breakOut "main"};
if ((!(_x isEqualType 0)) || {_x < 0 || _x > 1}) exitWith {false breakOut "main"};
} count _colorArray;
true

View File

@ -42,7 +42,7 @@ if (isNil QGVAR(MarkerColorsCache)) then {
_name = getText (_marker >> "name");
_rgba = getArray (_marker >> "color");
{
if (typeName _x != "SCALAR") then {
if (!( _x isEqualType 0)) then {
_rgba set [_forEachIndex, call compile _x];
};
} forEach _rgba;

View File

@ -37,7 +37,7 @@ _drawColor = getArray (_colorConfig >> "color");
//Convert possible code into numbers
{
if (typeName _x == "STRING") then {
if (_x isEqualType "") then {
_drawColor set [_forEachIndex, (call compile _x)];
};
} forEach _drawColor;

View File

@ -15,9 +15,9 @@
if (isnil QGVAR(unconsciousConditions)) then {
GVAR(unconsciousConditions) = [];
};
if (typeName _this == typeName []) then {
if (_this isEqualType []) then {
{
if (typeName _x == typeName {}) then {
if (_x isEqualType {}) then {
GVAR(unconsciousConditions) pushback _x;
};
} foreach _this;

View File

@ -57,7 +57,7 @@ if (getText (_config >> "condition") != "") then {
} else {
_condition = missionNamespace getvariable _condition;
};
if (typeName _condition == "BOOL") then {
if (_condition isEqualType false) then {
_return = _condition;
} else {
_return = [_caller, _target, _selectionName, _className] call _condition;
@ -86,7 +86,7 @@ _medVeh = {([_caller] call FUNC(isInMedicalVehicle)) || ([_target] call FUNC(isI
if !(isnil _x) exitwith {
private "_val";
_val = missionNamespace getvariable _x;
if (typeName _val == "SCALAR") then {
if (_val isEqualType 0) then {
_return = switch (_val) do {
case 0: {true}; //AdvancedMedicalSettings_anywhere
case 1: {call _medVeh}; //AdvancedMedicalSettings_vehicle

View File

@ -59,7 +59,7 @@ _createLitter = {
_createdLitter = [];
{
if (typeName _x == "ARRAY") then {
if (_x isEqualType []) then {
if (count _x < MIN_ENTRIES_LITTER_CONFIG) exitwith {};
_x params ["_selection", "_litterCondition", "_litterOptions"];
@ -70,17 +70,17 @@ _createdLitter = [];
_litterCondition = if (_litterCondition != "") then {compile _litterCondition} else {{true}};
} else {
_litterCondition = missionNamespace getvariable _litterCondition;
if (typeName _litterCondition != "CODE") then {_litterCondition = {false}};
if (!(_litterCondition isEqualType {})) then {_litterCondition = {false}};
};
if !([_caller, _target, _selectionName, _className, _usersOfItems, _previousDamage] call _litterCondition) exitwith {};
if (typeName _litterOptions == "ARRAY") then {
if (_litterOptions isEqualType []) then {
// Loop through through the litter options and place the litter
{
if (typeName _x == "ARRAY" && {(count _x > 0)}) then {
if (_x isEqualType [] && {(count _x > 0)}) then {
[_target, _x select (floor(random(count _x)))] call _createLitter;
};
if (typeName _x == "STRING") then {
if (_x isEqualType "") then {
[_target, _x] call _createLitter;
};
} foreach _litterOptions;

View File

@ -209,7 +209,7 @@ if (_show) then {
};
{
if (typeName _x == "STRING" && {isLocalized _x}) then {
if (_x isEqualType "" && {isLocalized _x}) then {
_arguments set [_foreachIndex, localize _x];
};
} foreach _arguments;

View File

@ -22,7 +22,7 @@ if (isnil QGVAR(unconsciousConditions)) then {
_return = false;
{
if (typeName _x == typeName {} && {([_unit] call _x)}) exitwith {
if ((_x isEqualType {}) && {([_unit] call _x)}) exitwith {
_return = true;
};
} foreach GVAR(unconsciousConditions);

View File

@ -28,7 +28,7 @@ if !(local _unit) exitWith {
private ["_damageReturn", "_typeOfDamage", "_minLethalDamage", "_newDamage", "_typeIndex", "_preventDeath"];
// bug, assumed fixed, @todo excessive testing, if nothing happens remove
if (typeName _projectile == "OBJECT") then {
if (_projectile isEqualType objNull) then {
_projectile = typeOf _projectile;
_this set [4, _projectile];
};

View File

@ -21,10 +21,10 @@ params ["_medic", "_patient", "_items"];
_return = true;
{
//
if (typeName _x == "ARRAY" && {({[_medic, _patient, _x] call FUNC(hasItem)}count _x == 0)}) exitwith {
if (_x isEqualType [] && {({[_medic, _patient, _x] call FUNC(hasItem)}count _x == 0)}) exitwith {
_return = false;
};
if (typeName _x == "STRING" && {!([_medic, _patient, _x] call FUNC(hasItem))}) exitwith {
if (_x isEqualType "" && {!([_medic, _patient, _x] call FUNC(hasItem))}) exitwith {
_return = false;
};
}foreach _items;

View File

@ -65,7 +65,7 @@ if (isText (_config >> "Condition")) then {
} else {
_condition = missionNamespace getvariable _condition;
};
if (typeName _condition == "BOOL") then {
if (_condition isEqualType false) then {
_return = _condition;
} else {
_return = [_caller, _target, _selectionName, _className] call _condition;
@ -98,7 +98,7 @@ if ("All" in _locations) then {
if !(isnil _x) exitwith {
private "_val";
_val = missionNamespace getvariable _x;
if (typeName _val == "SCALAR") then {
if (_val isEqualType 0) then {
_return = switch (_val) do {
case 0: {true}; //AdvancedMedicalSettings_anywhere
case 1: {call _medVeh}; //AdvancedMedicalSettings_vehicle
@ -205,7 +205,7 @@ _treatmentTime = if (isNumber (_config >> "treatmentTime")) then {
} else {
_treatmentTimeConfig = missionNamespace getvariable _treatmentTimeConfig;
};
if (typeName _treatmentTimeConfig == "SCALAR") exitwith {
if (_treatmentTimeConfig isEqualType 0) exitwith {
_treatmentTimeConfig;
};
[_caller, _target, _selectionName, _className] call _treatmentTimeConfig;

View File

@ -21,7 +21,7 @@ params ["_medic", "_patient", "_items"];
_itemsUsedBy = [];
{
// handle a one of type use item
if (typeName _x == "ARRAY") then {
if (_x isEqualType []) then {
{
_itemUsedInfo = [_medic, _patient, _x] call FUNC(useItem);
if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]};
@ -29,7 +29,7 @@ _itemsUsedBy = [];
};
// handle required item
if (typeName _x == "STRING") then {
if (_x isEqualType "") then {
_itemUsedInfo = [_medic, _patient, _x] call FUNC(useItem);
if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]};
};

View File

@ -31,7 +31,7 @@ lbClear _logCtrl;
};
{
if (typeName _x == "STRING" && {isLocalized _x}) then {
if (_x isEqualType "" && {isLocalized _x}) then {
_arguments set [_foreachIndex, localize _x];
};
} forEach _arguments;

View File

@ -31,7 +31,7 @@ lbClear _logCtrl;
};
{
if (typeName _x == "STRING" && {isLocalized _x}) then {
if (_x isEqualType "" && {isLocalized _x}) then {
_arguments set [_foreachIndex, localize _x];
};
} forEach _arguments;

View File

@ -67,7 +67,7 @@ _text = format ["
{
_var = missionNamespace getVariable [_x, nil];
if(!isnil "_var" && {(typeName _var) == "ARRAY"} && {(count _var) > MIN_ARRAY_SIZE}) then {
if(!isnil "_var" && {_var isEqualType []} && {(count _var) > MIN_ARRAY_SIZE}) then {
_text = format ["%1 - ARRAY SIZE: %2", _x, (count _var)];
[_text] call _outputText;
};
@ -77,7 +77,7 @@ _text = format ["
_unit = _x;
{
_var = _unit getVariable [_x, nil];
if(!isnil "_var" && {(typeName _var) == "ARRAY"} && {(count _var) > MIN_ARRAY_SIZE}) then {
if(!isnil "_var" && {_var isEqualType []} && {(count _var) > MIN_ARRAY_SIZE}) then {
_text = format ["%1 on [%2] - ARRAY SIZE: %3", _x, _unit, (count _var)];
[_text] call _outputText;
};

View File

@ -48,8 +48,8 @@ private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localize
format['value = "%1";', _value];
};
case ("bool"): {
if (typeName _value != "BOOL") then {ERROR("weird bool typename??");};
_value = if (((typeName _value) == "BOOL") && {_value}) then {1} else {0};
if (!(_value isEqualType false)) then {ERROR("weird bool typename??");};
_value = if ((_value isEqualType false) && {_value}) then {1} else {0};
format ['value = %1;', _value];
};
case ("color"): {

View File

@ -81,7 +81,7 @@ switch (GVAR(optionMenu_openTab)) do {
(_x select 0);
};
_settingsValue = _x select 9;
if (typeName _settingsValue != "STRING") then {
if (!(_settingsValue isEqualType "")) then {
_settingsValue = format["%1", _settingsValue];
};
_added = _ctrlList lnbAddRow [_settingName, _settingsValue];

View File

@ -43,7 +43,7 @@ if (_target isKindOf "StaticWeapon") then {
if (_magazine == "") exitWith {};
if (_weapon == "") exitWith {};
if (typeName _muzzle != "STRING") then {_muzzle = _weapon};
if (!( _muzzle isEqualType "")) then {_muzzle = _weapon};
_showNumber = false;
_ammo = 0;

View File

@ -122,10 +122,10 @@ _hitPointsAddedAmount = [];
_x params ["_hitpoint", "_position"];
// Exit with supplied custom position when same hitpoint name found or print RPT error if it's invalid
if (_hitpoint == _currentHitpoint) exitWith {
if (typeName _position == "ARRAY") exitWith {
if (_position isEqualType []) exitWith {
_selection = _position; // Position in model space
};
if (typeName _position == "STRING") exitWith {
if (_position isEqualType "") exitWith {
_selection = _vehicle selectionPosition _position; // Selection name
};
ACE_LOGERROR_3("Invalid custom position %1 of hitpoint %2 in vehicle %3.",_position,_hitpoint,_vehicle);
@ -134,7 +134,7 @@ _hitPointsAddedAmount = [];
};
// If position still empty (not a position array or selection name) try extracting from model
if (typeName _selection == "STRING" && {_selection == ""}) then {
if (_selection isEqualType "" && {_selection == ""}) then {
_selection = _vehicle selectionPosition (_hitPointsSelections select (_hitPoints find _x));
};

View File

@ -59,7 +59,7 @@ if (getText (_config >> "condition") != "") then {
} else {
_condition = missionNamespace getVariable _condition;
};
if (typeName _condition == "BOOL") then {
if (_condition isEqualType false) then {
_return = _condition;
} else {
_return = [_caller, _target, _hitPoint, _className] call _condition;
@ -89,7 +89,7 @@ _repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC
if !(isnil _x) exitwith {
private "_val";
_val = missionNamespace getVariable _x;
if (typeName _val == "SCALAR") then {
if (_val isEqualType 0) then {
_return = switch (_val) do {
case 0: {true}; //useAnywhere
case 1: {call _repairVeh}; //repairVehicleOnly

View File

@ -23,7 +23,7 @@ TRACE_4("params",_unit,_target,_hitPoint,_wheel);
if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false};
if (typeName _wheel == "OBJECT") then {
if (_wheel isEqualType objNull) then {
// not near interpret as objNull
if !(_wheel in nearestObjects [_unit, ["ACE_Track"], 5]) then {
_wheel = objNull;

View File

@ -24,7 +24,7 @@ TRACE_4("params",_unit,_target,_hitPoint,_track);
if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false};
if (typeName _track == "OBJECT") then {
if (_track isEqualType objNull) then {
// not near interpret as objNull
if !(_track in nearestObjects [_unit, ["ACE_Track"], 5]) then {
_track = objNull;

View File

@ -28,7 +28,7 @@ if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call
//if !([_unit, GVAR(engineerSetting_Wheel)] call FUNC(isEngineer)) exitWith {false};
// check for a near wheel
if (typeName _wheel == "OBJECT") then {
if (_wheel isEqualType objNull) then {
// not near interpret as objNull
if !(_wheel in nearestObjects [_unit, ["ACE_Wheel"], 5]) then {
_wheel = objNull;

View File

@ -23,10 +23,10 @@ private ["_return"];
_return = true;
{
if (typeName _x == "ARRAY" && {({[_unit, _x] call EFUNC(common,hasItem)} count _x == 0)}) exitwith {
if (_x isEqualType [] && {({[_unit, _x] call EFUNC(common,hasItem)} count _x == 0)}) exitwith {
_return = false;
};
if (typeName _x == "STRING" && {!([_unit, _x] call EFUNC(common,hasItem))}) exitwith {
if (_x isEqualType "" && {!([_unit, _x] call EFUNC(common,hasItem))}) exitwith {
_return = false;
};
} forEach _items;

View File

@ -24,6 +24,6 @@ _class = _unit getVariable ["ACE_IsEngineer", getNumber (configFile >> "CfgVehic
// This if statement is here for copmatability with the common variant of isEngineer, which requires a bool.
// We cannot move this function to common because we require the GVAR(engineerSetting_Repair), which only makes sense to include in the repair module.
if (typeName _class == "BOOL") then {_class = 1};
if (_class isEqualType false) then {_class = 1};
_class >= (_engineerN min GVAR(engineerSetting_Repair));

View File

@ -59,7 +59,7 @@ if (getText (_config >> "condition") != "") then {
} else {
_condition = missionNamespace getVariable _condition;
};
if (typeName _condition == "BOOL") then {
if (_condition isEqualType false) then {
_return = _condition;
} else {
_return = [_caller, _target, _hitPoint, _className] call _condition;
@ -88,7 +88,7 @@ _repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC
if !(isnil _x) exitwith {
private "_val";
_val = missionNamespace getVariable _x;
if (typeName _val == "SCALAR") then {
if (_val isEqualType 0) then {
_return = switch (_val) do {
case 0: {true}; //useAnywhere
case 1: {call _repairVeh}; //repairVehicleOnly
@ -167,7 +167,7 @@ _repairTime = if (isNumber (_config >> "repairingTime")) then {
} else {
_repairTimeConfig = missionNamespace getVariable _repairTimeConfig;
};
if (typeName _repairTimeConfig == "SCALAR") exitwith {
if (_repairTimeConfig isEqualType 0) exitwith {
_repairTimeConfig;
};
[_caller, _target, _hitPoint, _className] call _repairTimeConfig;

View File

@ -24,7 +24,7 @@ private ["_itemUsedInfo", "_itemsUsedBy"];
_itemsUsedBy = [];
{
// handle a one of type use item
if (typeName _x == "ARRAY") then {
if (_x isEqualType []) then {
{
_itemUsedInfo = [_unit, _x] call FUNC(useItem);
if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]};
@ -32,7 +32,7 @@ _itemsUsedBy = [];
};
// handle required item
if (typeName _x == "STRING") then {
if (_x isEqualType "") then {
_itemUsedInfo = [_unit, _x] call FUNC(useItem);
if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]};
};

View File

@ -61,7 +61,7 @@ if (_unit getVariable [QGVAR(actionID), -1] == -1) then {
] call EFUNC(common,addActionEventHandler)];
};
if (typeName _muzzle == "STRING") then {
if (_muzzle isEqualType "") then {
_unit selectWeapon _muzzle;
};

View File

@ -237,7 +237,7 @@ switch (_coordinate) do {
};
// trap errors
if ({typeName _x == "STRING"} count [_digit0, _digit1, _digit2, _digit3, _digit4] < 5) exitWith {
if ({_x isEqualType ""} count [_digit0, _digit1, _digit2, _digit3, _digit4] < 5) exitWith {
[QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa))] // return
};

View File

@ -35,7 +35,7 @@ if ((locked _veh) == 0) exitWith {false};
if (!("ACE_key_lockpick" in (items _unit))) exitWith {false};
_vehLockpickStrenth = _veh getVariable[QGVAR(lockpickStrength), GVAR(DefaultLockpickStrength)];
if (typeName _vehLockpickStrenth != "SCALAR") exitWith {ERROR("ACE_vehicleLock_LockpickStrength invalid"); false};
if (!(_vehLockpickStrenth isEqualType 0)) exitWith {ERROR("ACE_vehicleLock_LockpickStrength invalid"); false};
//-1 indicates unpickable lock
if (_vehLockpickStrenth < 0) exitWith {false};