From 7373585b0e7f62a210a6f20b36a587e19252f233 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Mon, 21 Oct 2013 12:02:42 -0500 Subject: [PATCH] same as last commit --- SQF/dayz_server/modules/crash_spawner.sqf | 2 +- SQF/dayz_server/modules/supply_drop.sqf | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/SQF/dayz_server/modules/crash_spawner.sqf b/SQF/dayz_server/modules/crash_spawner.sqf index 55af15436..b799e09bc 100644 --- a/SQF/dayz_server/modules/crash_spawner.sqf +++ b/SQF/dayz_server/modules/crash_spawner.sqf @@ -1,4 +1,4 @@ -private ["_guaranteedLoot","_randomizedLoot","_spawnChance","_spawnMarker","_spawnRadius","_spawnFire","_fadeFire","_crashModel","_lootTable","_crashName","_spawnRoll","_position","_crash","_config","_hasAdjustment","_newHeight","_adjustedPos","_num","_itemTypes","_index","_weights","_cntWeights","_nearby","_itemType"]; +private ["_guaranteedLoot","_randomizedLoot","_spawnChance","_spawnMarker","_spawnRadius","_spawnFire","_fadeFire","_crashModel","_lootTable","_crashName","_spawnRoll","_position","_crash","_config","_hasAdjustment","_newHeight","_adjustedPos","_num","_itemTypes","_index","_weights","_cntWeights","_nearby","_itemType","_needsrelocated","_istoomany"]; _guaranteedLoot = 3; _randomizedLoot = 4; diff --git a/SQF/dayz_server/modules/supply_drop.sqf b/SQF/dayz_server/modules/supply_drop.sqf index 9a899cb2a..b6bafcfb8 100644 --- a/SQF/dayz_server/modules/supply_drop.sqf +++ b/SQF/dayz_server/modules/supply_drop.sqf @@ -1,4 +1,4 @@ -private ["_guaranteedLoot","_randomizedLoot","_spawnChance","_spawnMarker","_spawnRadius","_crashModel","_lootTable","_spawnRoll","_position","_crash","_config","_num","_itemTypes","_index","_weights","_cntWeights","_nearby","_itemType"]; +private ["_guaranteedLoot","_randomizedLoot","_spawnChance","_spawnMarker","_spawnRadius","_crashModel","_lootTable","_spawnRoll","_position","_crash","_config","_num","_itemTypes","_index","_weights","_cntWeights","_nearby","_itemType","_needsrelocated","_istoomany"]; _guaranteedLoot = 4; _randomizedLoot = 8; @@ -13,9 +13,13 @@ if (_spawnRoll <= _spawnChance) then { _lootTable = "SupplyDrop"; - //_crashName = getText (configFile >> "CfgVehicles" >> _crashModel >> "displayName"); - - _position = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,2000,0] call BIS_fnc_findSafePos; + // Loop for a new location without any vehicles + _needsrelocated = true; + while {_needsrelocated} do { + _position = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,2000,0] call BIS_fnc_findSafePos; + _istoomany = _position nearObjects ["AllVehicles",10]; + if((count _istoomany) == 0) then { _needsrelocated = false; }; + }; //diag_log(format["CRASHSPAWNER: Spawning '%1' with loot table '%2' NOW! (%3) at: %4", _crashName, _lootTable, time, str(_position)]);