From 4ee52e38819c45b0c89abe5993379ba19396fd14 Mon Sep 17 00:00:00 2001 From: He-Man Date: Mon, 25 Jun 2018 18:21:25 +0200 Subject: [PATCH] Plots in var for later improvements --- .../EPOCH_server_loadBuildings.sqf | 19 ++++++++++++------- .../epoch_bases/EPOCH_server_saveBuilding.sqf | 4 ++++ .../EPOCH_server_save_killedBuilding.sqf | 5 ++++- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf index 4cdc4f55..f25ebf81 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf @@ -16,6 +16,7 @@ private ["_Simulated","_DamageAllowed","_ExceptedBaseObjects","_IndestructibleBaseObjects","_UseIndestructible","_VAL","_ammoClass","_ammoObj","_anims","_animsData","_arr","_arrCount","_baseObj","_buildingJammerRange","_cfgBaseBuilding","_cfgEpochClient","_class","_color","_damage","_location","_marker","_maxTTL","_owner","_response","_serverSettingsConfig","_storageSlot","_textureSlot","_ttl","_vehHiveKey","_worldspace"]; //[[[end]]] EPOCH_BaseCams = []; +EPOCH_Plotpoles = []; _maxTTL = parseNumber EPOCH_expiresBuilding; _serverSettingsConfig = configFile >> "CfgEpochServer"; _baseDynamicSimulationSystem = [_serverSettingsConfig, "baseDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntry; @@ -154,13 +155,16 @@ for "_i" from 0 to _this do { // Set PubVar later after all Cams are loaded in }; - if (_class isequalto "PlotPole_EPOCH" && EPOCH_SHOW_JAMMERS) then { - _marker = createMarker [str(_location), _location]; - _marker setMarkerShape "ICON"; - // TODO allow players to change this per base - _marker setMarkerType "mil_dot"; - // _marker setMarkerText _class; - _marker setMarkerColor "ColorBlue"; + if (_class isequalto "PlotPole_EPOCH") then { + EPOCH_Plotpoles pushbackunique _baseObj; + if (EPOCH_SHOW_JAMMERS) then { + _marker = createMarker [str(_location), _location]; + _marker setMarkerShape "ICON"; + // TODO allow players to change this per base + _marker setMarkerType "mil_dot"; + // _marker setMarkerText _class; + _marker setMarkerColor "ColorBlue"; + }; }; }; @@ -196,5 +200,6 @@ for "_i" from 0 to _this do { }; }; publicvariable "EPOCH_BaseCams"; +publicvariable "EPOCH_Plotpoles"; missionNamespace setVariable ["EPOCH_BuildingSlotCount", {_x == 0} count EPOCH_BuildingSlots, true]; true diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_saveBuilding.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_saveBuilding.sqf index 9190a9ba..3d1a92f7 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_saveBuilding.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_saveBuilding.sqf @@ -100,6 +100,10 @@ if (isText _staticClassConfig) then { else { _newVehicle setVariable["BUILD_OWNER", _playerUID, true]; }; + if (_newVehicle isKindOf "PlotPole_EPOCH") then { + EPOCH_Plotpoles pushBackUnique _newVehicle; + publicvariable "EPOCH_Plotpoles"; + }; _newVehicle call EPOCH_saveBuilding; }; diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_server_save_killedBuilding.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_server_save_killedBuilding.sqf index 5f8e9e09..4175adb0 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_server_save_killedBuilding.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_server_save_killedBuilding.sqf @@ -34,7 +34,10 @@ if (!isNull _building) then { EPOCH_BaseCams = EPOCH_BaseCams - [_building]; publicvariable "EPOCH_BaseCams"; }; - + if (_building iskindof "PlotPole_EPOCH") then { + EPOCH_Plotpoles = EPOCH_Plotpoles - [_building]; + publicvariable "EPOCH_Plotpoles"; + }; // Check if building killer is the owner and log accordingly if (_killer isequaltype objnull) then { if ((_building getVariable["BUILD_OWNER", "-1"]) in [getPlayerUID _killer, _killer getVariable["GROUP", ""]]) then