mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
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:
@@ -21,6 +21,6 @@ _nearWaterHole = [false,false];
|
||||
} count (nearestObjects [_x, [], 1]);
|
||||
|
||||
if (_nearWaterHole select 0) exitWith {};
|
||||
} forEach (nearestObjects [player, ["waterHoleProxy"], 50]);
|
||||
} forEach (player nearObjects ["waterHoleProxy",50]);
|
||||
|
||||
_nearWaterHole
|
||||
@@ -13,7 +13,7 @@ private ["_class","_sign","_near"];
|
||||
|
||||
_class = _this select 0;
|
||||
_sign = _this select 1;
|
||||
_near = count (nearestObjects [player,[_class],50]);
|
||||
_near = count (player nearObjects [_class,50]);
|
||||
|
||||
[_class,_sign,_near] spawn {
|
||||
_class = _this select 0;
|
||||
@@ -23,12 +23,12 @@ _near = count (nearestObjects [player,[_class],50]);
|
||||
|
||||
waitUntil {
|
||||
uiSleep 1;
|
||||
(count (nearestObjects [player,[_class],50]) != _near or (diag_tickTime - _time > 15))
|
||||
(count (player nearObjects [_class,50]) != _near or (diag_tickTime - _time > 15))
|
||||
};
|
||||
|
||||
if (!isNull _sign) then {
|
||||
deleteVehicle _sign;
|
||||
};
|
||||
|
||||
{player reveal _x;} count (nearestObjects [player,[_class],50]);
|
||||
{player reveal _x;} count (player nearObjects [_class,50]);
|
||||
};
|
||||
@@ -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; };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user