From 8796a2de89538e2acdfdb3167d149681cfe713b6 Mon Sep 17 00:00:00 2001 From: He-Man Date: Sun, 8 Apr 2018 01:02:54 +0200 Subject: [PATCH] Config to disable fuelsources in PlotRange --- .../@epochhive/epochconfig.hpp | 3 ++- Sources/epoch_server/init/server_init.sqf | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Server_Install_Pack/@epochhive/epochconfig.hpp b/Server_Install_Pack/@epochhive/epochconfig.hpp index ffb564dd..be4ab4fb 100644 --- a/Server_Install_Pack/@epochhive/epochconfig.hpp +++ b/Server_Install_Pack/@epochhive/epochconfig.hpp @@ -65,7 +65,8 @@ forceRestartTime = 14400; // 4 hour restarts // vehicles - Max vehicle slots is calculated from per vehicle limits below. Warning! Higher the number lower the performance. immuneIfStartInBase = "true"; // Protect vehicles from damage in bases until first unlocked after restart ReservedVehSlots = 50; // Reserved Vehicle Slots (only needed, if you manually spawn in additional Vehicles - AdminTool / Blackmarket...) - disableAutoRefuel = "true"; // Removes auto refuel from all buildings at server startup. + disableAutoRefuel = "false"; // Removes auto refuel from all buildings at server startup. + disableFuelNearPlots = "false"; // Removes auto refuel in PlotPole-Ranges at server startup. VehLockMessages = "true"; // Give players a hint, that the Vehicle is locked / unlocked removevehweapons[] = { // remove these Weapons from spawned Vehicles "missiles_DAR","gatling_30mm","gatling_20mm","missiles_DAGR","cannon_30mm_Plane_CAS_02_F","Missile_AA_03_Plane_CAS_02_F","Missile_AGM_01_Plane_CAS_02_F","Rocket_03_HE_Plane_CAS_02_F", diff --git a/Sources/epoch_server/init/server_init.sqf b/Sources/epoch_server/init/server_init.sqf index d7bd35c6..e8dff61d 100644 --- a/Sources/epoch_server/init/server_init.sqf +++ b/Sources/epoch_server/init/server_init.sqf @@ -273,14 +273,25 @@ _servicepoints = getArray (_config >> worldname >> 'ServicePoints'); } forEach _ServicePoints; // Remove Auto-Refuel from all maps - -if ([_serverSettingsConfig, "disableAutoRefuel", true] call EPOCH_fnc_returnConfigEntry) then { +if ([_serverSettingsConfig, "disableAutoRefuel", false] call EPOCH_fnc_returnConfigEntry) then { // get all fuel source objects on the map (Note: this maybe slow consider refactor with another command) _staticFuelSources = ((epoch_centerMarkerPosition nearObjects ['Building',EPOCH_dynamicVehicleArea]) select {getFuelCargo _x > 0}); // globalize all fuel sources missionNamespace setVariable ["EPOCH_staticFuelSources", _staticFuelSources, true]; - // disable fuel sources server side. (Note: might not be needed since we also need to do this client side) - {_x setFuelCargo 0;} foreach _staticFuelSources; +} +else { + // Remove Auto-Refuel in PlotPole-Range + if ([_serverSettingsConfig, "disableFuelNearPlots", true] call EPOCH_fnc_returnConfigEntry) then { + _buildingJammerRange = ["CfgEpochClient", "buildingJammerRange", 75] call EPOCH_fnc_returnConfigEntryV2; + _staticFuelSources = []; + { + { + _staticFuelSources pushback _x; + } foreach (((_x nearObjects ['Building',_buildingJammerRange]) select {getFuelCargo _x > 0})); + + } foreach (allmissionobjects "Plotpole_EPOCH"); + missionNamespace setVariable ["EPOCH_staticFuelSources", _staticFuelSources, true]; + }; }; // set time multiplier