Add some more typeNames replacements

This commit is contained in:
PabstMirror 2015-11-27 21:23:27 -06:00
parent 5850f78c1f
commit f676e6d9c9
8 changed files with 13 additions and 13 deletions

View File

@ -19,6 +19,6 @@ params ["_unit"];
private _isEngineer = _unit getVariable ["ACE_isEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1];
//Handle ace_repair modules setting this to a number
if ((typeName _isEngineer) == "SCALAR") then {_isEngineer = _isEngineer > 0};
if (_isEngineer isEqualType 0) then {_isEngineer = _isEngineer > 0};
_isEngineer

View File

@ -40,11 +40,11 @@ params [
["_modifierFunction", {}]
];
_position = if (typeName (_position) == "STRING") then {
_position = if (_position isEqualType "") then {
// If the action is set to a selection, create the suitable code
compile format ["_target selectionPosition '%1'", _position];
} else {
if (typeName (_position) == "ARRAY") then {
if (_position isEqualType []) then {
// If the action is set to a array position, create the suitable code
compile format ["%1", _position];
} else {

View File

@ -78,10 +78,10 @@ if (GVAR(openedMenuType) >= 0) then {
// Execute the current action if it's run on hover
private _tmp = ((GVAR(selectedAction) select 0) select 9) select 3;
private _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

@ -109,10 +109,10 @@ _processedHitpoints = [];
{
_x params ["_hit", "_pos"];
if (_hitpoint == _hit) exitWith {
if (typeName _pos == "ARRAY") exitWith {
if (_pos isEqualType []) exitWith {
_position = _pos; // Position in model space
};
if (typeName _pos == "STRING") exitWith {
if (_pos isEqualType "") exitWith {
_position = compile format ["_target selectionPosition ['%1', 'HitPoints'];", _pos];
};
ACE_LOGERROR_3("Invalid custom position %1 of hitpoint %2 in vehicle %3.",_position,_hitpoint,_type);

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;
@ -85,7 +85,7 @@ if (!("All" in _repairLocations)) then {
if (_x == "RepairVehicle" && _repairVeh) exitWith {_return = true;};
if !(isNil _x) exitWith {
private _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

@ -84,7 +84,7 @@ if (!("All" in _repairLocations)) then {
if (_x == "RepairVehicle" && _repairVeh) exitWith {_return = true;};
if !(isNil _x) exitWith {
private _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
@ -181,7 +181,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

@ -27,7 +27,7 @@ private["_damageNew", "_damageOld", "_hitPointDamageRepaired", "_hitPointDamageS
if !(local _vehicle) exitWith {ACE_LOGERROR_1("Vehicle Not Local %1", _vehicle);};
//Check for bad typeName (changed from orignal v3.3 that took string)
if ((typeName _hitPointIndex) == "STRING") then {
if (_hitPointIndex isEqualType "") then {
ACE_DEPRECATED("repair-setHitPointDamage (hit point name <string>","3.5.0","hit index <number>");
_hitPointIndex = _allHitPoints find _hitPointIndex;
};

View File

@ -237,7 +237,7 @@ switch (_coordinate) do {
};
// trap errors
if ({_x isEqualType ""} count [_digit0, _digit1, _digit2, _digit3, _digit4] < 5) exitWith {
if ([_digit0, _digit1, _digit2, _digit3, _digit4] isEqualTypeAll "") 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
};