From 0d5d0b9b8eebdcf5f68cc8daab421e918e9a22c5 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Tue, 29 Jul 2014 15:50:53 -0400 Subject: [PATCH] Change count back to forEach - fix empty safes See Kronzky's note: https://community.bistudio.com/wiki/count You can only use count to iterate through an array if all elements in the array are of the same data type. In this case you have an array with strings (type), arrays (worldspace, inventory, hitpoints) and numbers (fuel, ownerID). You need to use forEach instead. This error explains the problem people were having with safe inventories being empty when they open them after a restart: http://epochmod.com/forum/index.php?/topic/13423-safe-is-empty-after-restart-if-you-open-it/ https://github.com/vbawol/DayZ-Epoch/issues/1368 https://github.com/vbawol/DayZ-Epoch/issues/1422 --- SQF/dayz_server/system/server_monitor.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SQF/dayz_server/system/server_monitor.sqf b/SQF/dayz_server/system/server_monitor.sqf index 5612e5185..336bf1216 100644 --- a/SQF/dayz_server/system/server_monitor.sqf +++ b/SQF/dayz_server/system/server_monitor.sqf @@ -256,7 +256,7 @@ if (isServer && isNil "sm_done") then { //Monitor the object PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_object]; }; - } count (_BuildingQueue + _objectQueue); + } forEach (_BuildingQueue + _objectQueue); // # END SPAWN OBJECTS # // preload server traders menu data into cache