From 43b68af0030e987abe4eb0719ced037cc409fa23 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Sun, 8 Dec 2013 09:53:24 -0600 Subject: [PATCH] entities instead of allMissionObjects code lock if already running cleanup --- SQF/dayz_code/system/player_monitor.fsm | 6 +++--- SQF/dayz_server/init/server_functions.sqf | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/SQF/dayz_code/system/player_monitor.fsm b/SQF/dayz_code/system/player_monitor.fsm index e53e7326a..1c4e6e6ac 100644 --- a/SQF/dayz_code/system/player_monitor.fsm +++ b/SQF/dayz_code/system/player_monitor.fsm @@ -978,8 +978,8 @@ class FSM "0 fadeMusic 0.5;" \n "" \n "//Check mission objects" \n - "{ _id = [_x,0] spawn object_roadFlare } forEach (allMissionObjects ""RoadFlare"");" \n - "{ _id = [_x,1] spawn object_roadFlare } forEach (allMissionObjects ""ChemLight"");"/*%FSM*/; + "{ _id = [_x,0] spawn object_roadFlare } forEach (entities ""RoadFlare"");" \n + "{ _id = [_x,1] spawn object_roadFlare } forEach (entities ""ChemLight"");"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { @@ -1242,7 +1242,7 @@ class FSM " if (!_fadeFire) then {" \n " _nul = [_x,2,0,false,false] spawn BIS_Effects_Burn;" \n " };" \n - "} forEach allMissionObjects ""SpawnableWreck"";" \n + "} forEach entities ""SpawnableWreck"";" \n "" \n "// remove box " \n "[] spawn {" \n diff --git a/SQF/dayz_server/init/server_functions.sqf b/SQF/dayz_server/init/server_functions.sqf index 7585a8e12..f121db628 100644 --- a/SQF/dayz_server/init/server_functions.sqf +++ b/SQF/dayz_server/init/server_functions.sqf @@ -724,6 +724,10 @@ server_timeSync = { // must spawn these server_spawncleanDead = { private ["_deathTime","_delQtyZ","_delQtyP","_qty","_allDead"]; + + if(!isNil "DZE_DYN_cleandead") exitWith { }; + DZE_DYN_cleandead = true; + _allDead = allDead; _delQtyZ = 0; _delQtyP = 0; @@ -752,6 +756,7 @@ server_spawncleanDead = { _qty = count _allDead; diag_log (format["CLEANUP: Deleted %1 players and %2 zombies out of %3 dead",_delQtyP,_delQtyZ,_qty]); }; + DZE_DYN_cleandead = nil; }; server_spawnCleanNull = { @@ -773,7 +778,7 @@ server_spawnCleanNull = { server_spawnCleanFire = { private ["_delQtyFP","_qty","_delQtyNull","_missionFires"]; - _missionFires = allMissionObjects "Land_Fire_DZ"; + _missionFires = entities "Land_Fire_DZ"; _delQtyFP = 0; { if (local _x) then { @@ -791,7 +796,10 @@ server_spawnCleanFire = { server_spawnCleanLoot = { private ["_created","_delQty","_nearby","_age","_keep","_qty","_missionObjs","_dateNow"]; - _missionObjs = allMissionObjects "ReammoBox"; + if(!isNil "DZE_DYN_cleanLoot") exitWith { }; + DZE_DYN_cleanLoot = true; + + _missionObjs = entities "ReammoBox"; _delQty = 0; _dateNow = (DateToNumber date); { @@ -819,11 +827,14 @@ server_spawnCleanLoot = { _qty = count _missionObjs; diag_log (format["CLEANUP: Deleted %1 Loot Piles out of %2",_delQty,_qty]); }; + DZE_DYN_cleanLoot = nil; }; server_spawnCleanAnimals = { private ["_pos","_delQtyAnimal","_qty","_missonAnimals","_nearby"]; - _missonAnimals = allMissionObjects "CAAnimalBase"; + if(!isNil "DZE_DYN_cleanAnimals") exitWith { }; + DZE_DYN_cleanLoot = true; + _missonAnimals = entities "CAAnimalBase"; _delQtyAnimal = 0; { if (local _x) then { @@ -849,4 +860,5 @@ server_spawnCleanAnimals = { _qty = count _missonAnimals; diag_log (format["CLEANUP: Deleted %1 Animals out of %2",_delQtyAnimal,_qty]); }; + DZE_DYN_cleanLoot = nil; }; \ No newline at end of file