Skip to content

Commit

Permalink
rad zone blacklist obj and distance
Browse files Browse the repository at this point in the history
  • Loading branch information
ravmustang committed Oct 22, 2017
1 parent b113bd5 commit 431e10e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
19 changes: 12 additions & 7 deletions Sources/epoch_server/init/server_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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{

This comment has been minimized.

Copy link
@raymix

raymix Oct 23, 2017

Contributor

Wouldn't this remove all zones and markers if at least 1 obj is defined?

This comment has been minimized.

Copy link
@ravmustang

ravmustang Oct 23, 2017

Author Contributor

Just seen this msg but took care of that here
a210dfa

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;
};
};
};
};
Expand Down
3 changes: 3 additions & 0 deletions Sources/epoch_server_settings/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"};
Expand Down

0 comments on commit 431e10e

Please sign in to comment.