From 431e10ee582df19e2b9a9969b4dee284a3bda090 Mon Sep 17 00:00:00 2001 From: "DESKTOP-UH65DCE\\MusTanG" Date: Sun, 22 Oct 2017 18:55:12 -0500 Subject: [PATCH] rad zone blacklist obj and distance --- Sources/epoch_server/init/server_init.sqf | 19 ++++++++++++------- Sources/epoch_server_settings/config.cpp | 3 +++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Sources/epoch_server/init/server_init.sqf b/Sources/epoch_server/init/server_init.sqf index d13851fb..709ba6b4 100644 --- a/Sources/epoch_server/init/server_init.sqf +++ b/Sources/epoch_server/init/server_init.sqf @@ -259,6 +259,8 @@ missionNamespace setVariable ["EPOCH_taxRate", [_serverSettingsConfig, "taxRate" // pick random radioactive locations _radioactiveLocations = getArray(_epochConfig >> worldName >> "radioactiveLocations"); +_blacklist = getArray(_epochConfig >> worldName >> "radioactiveLocBLObjects"); +_distance = getNumber(_epochConfig >> worldName >> "radioactiveLocBLDistance"); _radioactiveLocationsTmp = []; if !(_radioactiveLocations isEqualTo []) then { private _locations = nearestLocations[epoch_centerMarkerPosition, _radioactiveLocations, EPOCH_dynamicVehicleArea]; @@ -267,13 +269,16 @@ if !(_radioactiveLocations isEqualTo []) then { for "_i" from 0 to ((getNumber(_epochConfig >> worldName >> "radioactiveLocationsCount"))-1) do { if (_locations isEqualTo []) exitWith {}; - private _selectedLoc = selectRandom _locations; - _locations = _locations - [_selectedLoc]; - _locSize = size _selectedLoc; - _radius = sqrt((_locSize select 0)^2 + (_locSize select 1)^2); - _radioactiveLocationsTmp pushBack [_selectedLoc,[random 666,_radius]]; - private _position = locationPosition _selectedLoc; - _markers = ["Radiation", _position] call EPOCH_server_createGlobalMarkerSet; + _nearBLObj = nearestObjects [_position, _blacklist, _distance]; + if(_nearBLObj isEqualTo [])then{ + private _selectedLoc = selectRandom _locations; + _locations = _locations - [_selectedLoc]; + _locSize = size _selectedLoc; + _radius = sqrt((_locSize select 0)^2 + (_locSize select 1)^2); + _radioactiveLocationsTmp pushBack [_selectedLoc,[random 666,_radius]]; + private _position = locationPosition _selectedLoc; + _markers = ["Radiation", _position] call EPOCH_server_createGlobalMarkerSet; + }; }; }; }; diff --git a/Sources/epoch_server_settings/config.cpp b/Sources/epoch_server_settings/config.cpp index 547bde47..41e6e077 100644 --- a/Sources/epoch_server_settings/config.cpp +++ b/Sources/epoch_server_settings/config.cpp @@ -63,6 +63,9 @@ class CfgEpoch }; radioactiveLocations[] = {"NameCityCapital", "NameCity", "Airport"}; radioactiveLocationsCount = 3; + // Block radioactive locations spawn + radioactiveLocBLObjects = ["PlotPole_EPOCH"]; + radioactiveLocBLDistance = 500; traderBlds[] = {"House", "Building"}; traderHomes[] = {"House", "Building"}; traderUniforms[] = {"U_OG_leader", "U_C_Poloshirt_stripped", "U_C_Poloshirt_blue", "U_C_Poloshirt_burgundy", "U_C_Poloshirt_tricolour", "U_C_Poloshirt_salmon", "U_C_Poloshirt_redwhite", "U_C_Poor_1", "U_C_WorkerCoveralls", "U_C_Journalist", "U_C_Scientist", "U_OrestesBody"};