Fix random spawned vehicle loot saving

Dynamic vehicle loot will save to database now even if no players
interact with the vehicle before restart.
This commit is contained in:
ebaydayz
2016-09-12 12:23:23 -04:00
parent 66ac72ea9d
commit d98025c8d9
3 changed files with 9 additions and 5 deletions

View File

@@ -454,6 +454,7 @@ if (_hiveLoaded) then {
// spawn_vehicles
// Get all buildings and roads only once. Very taxing, but only on first startup
_serverVehicleCounter = _this;
_vehiclesToUpdate = [];
_startTime = diag_tickTime;
_buildingList = [];
_cfgLootFile = missionConfigFile >> "CfgLoot" >> "Buildings";
@@ -483,6 +484,9 @@ if (_hiveLoaded) then {
for "_x" from 1 to MaxMineVeins do {call spawn_mineveins;};
diag_log format["HIVE: BENCHMARK - Server finished spawning %1 DynamicVehicles, %2 Debris, %3 SupplyCrates and %4 MineVeins in %5 seconds",_vehLimit,MaxDynamicDebris,MaxAmmoBoxes,MaxMineVeins,diag_tickTime - _startTime];
//Update gear last after all dynamic vehicles are created to save random loot to database (low priority)
{[_x,"gear"] call server_updateObject} count _vehiclesToUpdate;
};
};