Use nearObjects instead of nearestObjects for spawn check #1816

Lowered spawn check radius for loot and zombies to the same as 1051.
(200m)
This commit is contained in:
ebaydayz
2017-01-30 15:45:14 -05:00
parent 752ed00566
commit 05f1cf9fe0
4 changed files with 12 additions and 11 deletions

View File

@@ -1,10 +1,9 @@
private ["_isWreck","_maxControlledZombies","_looted","_zombied","_doNothing","_spawnZedRadius","_serverTime","_age","_nearbyBuildings","_position","_spawnableObjects","_speed","_radius","_maxlocalspawned","_maxWeaponHolders","_currentWeaponHolders","_maxtoCreate","_inVehicle","_isAir","_isLand","_isSea","_Controlledzeddivided","_totalcrew","_nearby","_type","_config","_canSpawn","_dis","_checkLoot","_islocal","_bPos","_zombiesNum"];
private ["_isWreck","_maxControlledZombies","_looted","_zombied","_doNothing","_spawnZedRadius","_serverTime","_age","_nearbyBuildings","_position","_speed","_radius","_maxlocalspawned","_maxWeaponHolders","_currentWeaponHolders","_maxtoCreate","_inVehicle","_isAir","_isLand","_isSea","_Controlledzeddivided","_totalcrew","_nearby","_type","_config","_canSpawn","_dis","_checkLoot","_islocal","_bPos","_zombiesNum"];
_age = -1;
//_nearbyBuildings = [];
_position = [player] call FNC_GetPos;
_spawnableObjects = ["building", "CrashSite", "IC_Fireplace1", "IC_DomeTent", "IC_Tent"];
_speed = speed (vehicle player);
_radius = 300; //150*0.707; Pointless Processing (106.5)
_radius = 200; //150*0.707; Pointless Processing (106.5)
_spawnZedRadius = 20;
/*
@@ -99,8 +98,10 @@ if (_doNothing) exitwith {};
_maxlocalspawned, _maxControlledZombies, _radius, round diag_fpsmin,dayz_currentGlobalZombies,
dayz_maxGlobalZeds, dayz_CurrentNearByZombies, dayz_maxNearByZombies, _currentWeaponHolders,_maxWeaponHolders]);
};*/
_nearby = nearestObjects [_position, _spawnableObjects,_radius];
// nearObjects is faster than nearestObjects when sorting by distance isn't needed
// "Building" includes House and all of its child classes (Crashsite, IC_Fireplace1, IC_Tent, etc.)
_nearby = _position nearObjects ["Building",_radius];
_maxlocalspawned = _maxlocalspawned max floor(_maxControlledZombies*.8);
if (_maxlocalspawned > 0) then { _spawnZedRadius = _spawnZedRadius * 3; };