diff --git a/SQF/dayz_code/actions/player_gather.sqf b/SQF/dayz_code/actions/player_gather.sqf index 70e4e1a29..fe569f4bf 100644 --- a/SQF/dayz_code/actions/player_gather.sqf +++ b/SQF/dayz_code/actions/player_gather.sqf @@ -4,7 +4,7 @@ _plant = _this; if (_plant getVariable["Gathering",false]) exitWith {}; _originalCount = getNumber (configFile >> "CfgVehicles" >> (typeOf _plant) >> "TransportMagazines" >> "_xx_leaf" >> "count"); -if !([ [[["equip_comfreyleafs"],[_originalCount]],[[],[]]] , [getMagazineCargo _plant, getWeaponCargo _plant] ] call BIS_fnc_areEqual) then { +if !([ [[["equip_comfreyleafs"],[_originalCount]],[[],[]]] , [getMagazineCargo _plant, getWeaponCargo _plant] ] call fnc_isEqual) then { //diag_log [ [getMagazineCargo _plant, getWeaponCargo _plant], "!=", [[["equip_comfreyleafs"],[_originalCount]],[[],[]]] ]; _plant setVariable["Gathering",true]; // avoid multiple call because the fn_selfActions is called in an infinite loop [_this] spawn { // in background to be called after fn_selfActions diff --git a/SQF/dayz_code/compile/fn_isEqual.sqf b/SQF/dayz_code/compile/fn_isEqual.sqf new file mode 100644 index 000000000..3974b1517 --- /dev/null +++ b/SQF/dayz_code/compile/fn_isEqual.sqf @@ -0,0 +1,14 @@ +/* + Kilzone_Kid's megafast isEqual function + params [array1,array2] + + Examples: + hint str ([[1,2,3], [1,2,3]] call fnc_isEqual); //true + hint str ([[1,[2,[3]]], [1,[2,[3]]]] call fnc_isEqual); //true + hint str ([[1,[2,[3]]], [1,[2,[4]]]] call fnc_isEqual); //false +*/ + +switch (_this select 0) do { + case (_this select 1) : {true}; + default {false}; +}; \ No newline at end of file diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index 86c37d446..c995c31c5 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -595,6 +595,7 @@ fnc_veh_handleRepair = compile preprocessFileLineNumbers "\z\addons\dayz_code\co fnc_veh_ResetEH = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\veh_ResetEH.sqf"; //Initialize vehicle fnc_veh_setFixServer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_setFixServer.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles) fnc_inString = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inString.sqf"; +fnc_isEqual = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isEqual.sqf"; fnc_isInsideBuilding = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding; dayz_zombieSpeak = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_speak.sqf"; //Used to generate random speech for a unit vehicle_getHitpoints = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_getHitpoints.sqf"; diff --git a/SQF/dayz_server/system/server_monitor.sqf b/SQF/dayz_server/system/server_monitor.sqf index 8dbf91e8b..7e729f07c 100644 --- a/SQF/dayz_server/system/server_monitor.sqf +++ b/SQF/dayz_server/system/server_monitor.sqf @@ -334,7 +334,7 @@ createCenter civilian; actualSpawnMarkerCount = 0; // count valid spawn markers, since different maps have different amounts for "_i" from 0 to 10 do { - if !([(getMarkerPos format["spawn%1",_i]), [0,0,0]] call BIS_fnc_areEqual) then { + if !([(getMarkerPos format["spawn%1",_i]), [0,0,0]] call fnc_isEqual) then { actualSpawnMarkerCount = actualSpawnMarkerCount + 1; } else { _i = 11; // exit since we did not find any further markers