move rads for locations to client

locations cannot use public var option
This commit is contained in:
vbawol 2017-10-02 10:06:04 -05:00
parent 8e698e95db
commit bf7d35b519
2 changed files with 11 additions and 1 deletions

View File

@ -330,3 +330,10 @@ _EPOCH_BuildTraderMisson = {
_epoch_tradermissionarray = [];
EPOCH_ActiveTraderMission = [];
_LastMissionTrigger = 0;
// setup radio active locations
{
_x params ["_loc", "_rads"];
_loc setVariable ["EPOCH_Rads", _rads];
} forEach (missionNamespace getVariable ["EPOCH_radioactiveLocations", []]);
//

View File

@ -278,15 +278,17 @@ missionNamespace setVariable ["EPOCH_taxRate", [_serverSettingsConfig, "taxRate"
// pick random radioactive locations
_radioactiveLocations = getArray(_epochConfig >> worldName >> "radioactiveLocations");
_radioactiveLocationsTmp = [];
if !(_radioactiveLocations isEqualTo []) then {
private _locations = nearestLocations[epoch_centerMarkerPosition, _radioactiveLocations, EPOCH_dynamicVehicleArea];
if !(_locations isEqualTo []) then {
for "_i" from 0 to (getNumber(_epochConfig >> worldName >> "radioactiveLocationsCount")) do
{
if (_locations isEqualTo []) exitWith {};
private _selectedLoc = selectRandom _locations;
_locations = _locations - [_selectedLoc];
_selectedLoc setVariable ["EPOCH_Rads", random 666, true];
_radioactiveLocationsTmp pushBack [_selectedLoc,random 666];
private _position = locationPosition _selectedLoc;
_marker = name _selectedLoc;
_marker = createMarker[_marker, _position];
@ -297,6 +299,7 @@ if !(_radioactiveLocations isEqualTo []) then {
};
};
};
missionNamespace setVariable ["EPOCH_radioactiveLocations", _radioactiveLocationsTmp, true];
// start accepting logins
missionNamespace setVariable ["EPOCH_SERVER_READY", true, true];