mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
check to prevent spawning crashes on top of a vehicle or base
This commit is contained in:
@@ -21,8 +21,14 @@ if (_spawnRoll <= _spawnChance) then {
|
||||
};
|
||||
|
||||
_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)]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user