From 29c239e6dbdb177214dcb7d12d1a505337da3e54 Mon Sep 17 00:00:00 2001 From: Darren Date: Mon, 19 Jun 2017 07:59:07 -0400 Subject: [PATCH 1/2] Remove Auto-Refuel from Altis/Stratis/Tanoa/(Malden 2035?) --- Sources/epoch_server/init/server_init.sqf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/epoch_server/init/server_init.sqf b/Sources/epoch_server/init/server_init.sqf index da1878d2..4c43cf23 100644 --- a/Sources/epoch_server/init/server_init.sqf +++ b/Sources/epoch_server/init/server_init.sqf @@ -13,7 +13,7 @@ https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/init/server_init.sqf */ //[[[cog import generate_private_arrays ]]] -private ["_ReservedSlots","_SideHQ1","_SideHQ2","_SideHQ3","_abortAndError","_allowedVehicleIndex","_allowedVehicleListName","_allowedVehiclesList","_allowedVehiclesListArray","_cfgServerVersion","_channelColor","_channelNumber","_channelTXT","_clientVersion","_config","_configSize","_configVersion","_date","_dateChanged","_epochConfig","_epochWorldPath","_existingStock","_hiveVersion","_index","_indexStock","_instanceID","_marker","_radio","_response","_sapper","_serverConfig","_serverSettingsConfig","_servicepoints","_startTime","_staticDateTime","_timeDifference","_vehicleCount","_vehicleSlotLimit","_worldSize"]; +private ["_ReservedSlots","_SideHQ1","_SideHQ2","_SideHQ3","_abortAndError","_allowedVehicleIndex","_allowedVehicleListName","_allowedVehiclesList","_allowedVehiclesListArray","_cfgServerVersion","_channelColor","_channelNumber","_channelTXT","_clientVersion","_config","_configSize","_configVersion","_date","_dateChanged","_epochConfig","_epochWorldPath","_existingStock","_hiveVersion","_index","_indexStock","_instanceID","_marker","_radio","_response","_sapper","_serverConfig","_serverSettingsConfig","_servicepoints","_startTime","_staticDateTime","_timeDifference","_vehicleCount","_vehicleSlotLimit","_worldSize","_pumps","_allPumps"]; //[[[end]]] _startTime = diag_tickTime; missionNamespace setVariable ['Epoch_ServerVersion', getText(configFile >> "CfgMods" >> "Epoch" >> "version"), true]; @@ -259,6 +259,11 @@ _servicepoints = getArray (_config >> worldname >> 'ServicePoints'); }; } forEach _ServicePoints; +// Remove Auto-Refuel from Altis/Stratis/Tanoa/(Malden 2035?) +_pumps = ['Land_fs_feed_F','Land_FuelStation_Feed_F','Land_FuelStation_01_pump_F','Land_FuelStation_02_pump_F']; +_allPumps = (epoch_centerMarkerPosition nearObjects EPOCH_dynamicVehicleArea) select {(getFuelCargo _x > 0) AND (typeOf _x in _pumps)}; +{_x setFuelCargo 0;} foreach _allPumps; + // set time multiplier setTimeMultiplier ([_serverSettingsConfig, "timeMultiplier", 1] call EPOCH_fnc_returnConfigEntry); From bf593013b85f2600a5f16ee96377332558b8afbe Mon Sep 17 00:00:00 2001 From: Darren Date: Mon, 19 Jun 2017 08:13:58 -0400 Subject: [PATCH 2/2] Better Code using TypeName and Lazy Evaluation nearestObjects might not work in this context. Using nearObjects. Changed to nearObjects TypeName syntax, added lazy evaluation to the select. --- Sources/epoch_server/init/server_init.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/epoch_server/init/server_init.sqf b/Sources/epoch_server/init/server_init.sqf index 4c43cf23..6c916869 100644 --- a/Sources/epoch_server/init/server_init.sqf +++ b/Sources/epoch_server/init/server_init.sqf @@ -261,7 +261,7 @@ _servicepoints = getArray (_config >> worldname >> 'ServicePoints'); // Remove Auto-Refuel from Altis/Stratis/Tanoa/(Malden 2035?) _pumps = ['Land_fs_feed_F','Land_FuelStation_Feed_F','Land_FuelStation_01_pump_F','Land_FuelStation_02_pump_F']; -_allPumps = (epoch_centerMarkerPosition nearObjects EPOCH_dynamicVehicleArea) select {(getFuelCargo _x > 0) AND (typeOf _x in _pumps)}; +_allPumps = ((epoch_centerMarkerPosition) nearObjects ['House',(EPOCH_dynamicVehicleArea)]) select {(typeOf _x in _pumps) AND {getFuelCargo _x > 0}}; {_x setFuelCargo 0;} foreach _allPumps; // set time multiplier