From fe9f59bed7f91bd8a897b4fee7bc5788816b9cbc Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 3 Jun 2024 04:00:12 -0500 Subject: [PATCH] Refuel - Fix for SOG/SPE (#10049) * Refuel - Fix SOG/SPE Compats * fix export * Added missing fuel sources, improved some existing hook positions * Removed outdated todo * Add default code if refuel isn't loaded --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/compat_sog/CfgEventHandlers.hpp | 10 ++++ addons/compat_sog/CfgVehicles/land.hpp | 49 ++++++++++++++++--- addons/compat_sog/config.cpp | 3 +- .../compat_spe_refuel/CfgVehicles.hpp | 2 - addons/refuel/ACE_Refuel_Positions.hpp | 8 ++- .../dev/exportTerrainRefuelPositions.sqf | 13 ++++- 6 files changed, 73 insertions(+), 12 deletions(-) diff --git a/addons/compat_sog/CfgEventHandlers.hpp b/addons/compat_sog/CfgEventHandlers.hpp index fc6d80fc5f..d28b79fb99 100644 --- a/addons/compat_sog/CfgEventHandlers.hpp +++ b/addons/compat_sog/CfgEventHandlers.hpp @@ -32,6 +32,16 @@ class Extended_InitPost_EventHandlers { init = QUOTE((_this select 0) setMass 1e-12); }; }; + class Land_vn_canisterfuel_f { + class ADDON { + init = QUOTE(call (missionNamespace getVariable [ARR_2(QQEFUNC(refuel,makeJerryCan),{})])); + }; + }; + class Land_vn_fuelcan { + class ADDON { + init = QUOTE(call (missionNamespace getVariable [ARR_2(QQEFUNC(refuel,makeJerryCan),{})])); + }; + }; class vn_bicycle_base { class ADDON { init = QUOTE(call FUNC(disableCookoff)); diff --git a/addons/compat_sog/CfgVehicles/land.hpp b/addons/compat_sog/CfgVehicles/land.hpp index c939026590..70b305a31d 100644 --- a/addons/compat_sog/CfgVehicles/land.hpp +++ b/addons/compat_sog/CfgVehicles/land.hpp @@ -1,18 +1,19 @@ +#define XEH_INHERITED class EventHandlers {class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {};} // fuel pumps class Land_vn_commercial_base; class Land_vn_fuelstation_01_pump_f: Land_vn_commercial_base { - transportFuel = 0; + XEH_INHERITED; EGVAR(refuel,hooks)[] = {{0, 0.4, -0.5}, {0, -0.4, -0.5}}; EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; }; class Land_vn_fuelstation_02_pump_f: Land_vn_commercial_base { - transportFuel = 0; + XEH_INHERITED; EGVAR(refuel,hooks)[] = {{0, 0.4, -0.5}, {0, -0.4, -0.5}}; EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; }; class Land_vn_fuelstation_feed_f: Land_vn_commercial_base { - transportFuel = 0; + XEH_INHERITED; EGVAR(refuel,hooks)[] = {{0, 0.4, -0.5}, {0, -0.4, -0.5}}; EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; }; @@ -20,13 +21,47 @@ class Land_vn_fuelstation_feed_f: Land_vn_commercial_base { // fuel objects class Land_vn_building_b_base; class Land_vn_usaf_fueltank_75_01: Land_vn_building_b_base { - transportFuel = 0; - EGVAR(refuel,hooks)[] = {{0, -0.4, -0.5}}; + XEH_INHERITED; + EGVAR(refuel,hooks)[] = {{-2.52, -2.2, -2.05}, {2.5, 0, -1.3}}; EGVAR(refuel,fuelCargo) = 2840; // 750 * 3.785 }; +class Land_vn_b_prop_fuelbladder_01: Land_vn_usaf_fueltank_75_01 { + EGVAR(refuel,hooks)[] = {{-1.75, -6.7, -1}}; + EGVAR(refuel,fuelCargo) = 3785; // 1000 * 3.785 +}; +class Land_vn_b_prop_fuelbladder_03: Land_vn_b_prop_fuelbladder_01 { + EGVAR(refuel,hooks)[] = {{-1.55, -6.5, -1}}; +}; +class Land_vn_building_industrial_base; +class Land_vn_fuel_tank_stairs: Land_vn_building_industrial_base { + XEH_INHERITED; + EGVAR(refuel,hooks)[] = {{0, 0.4, -1.3}, {0, -0.4, -1.3}}; + EGVAR(refuel,fuelCargo) = 10000; // reference is B_Slingload_01_Fuel_F +}; class Land_vn_object_b_base; class Land_vn_b_prop_fueldrum_01: Land_vn_object_b_base { - transportFuel = 0; - EGVAR(refuel,hooks)[] = {{0, 0, 0.5}}; // reference is Land_FlexibleTank_01_F + XEH_INHERITED; + EGVAR(refuel,hooks)[] = {{0, 0, 0}}; EGVAR(refuel,fuelCargo) = 300; // reference is Land_FlexibleTank_01_F }; +class Land_vn_b_prop_fueldrum_02: Land_vn_b_prop_fueldrum_01 { + EGVAR(refuel,hooks)[] = {{0, -1.3, -0.15}, {2.3, 1.25, -0.15}}; + EGVAR(refuel,fuelCargo) = 14100; // (23 + 24) * 300 +}; +class vn_b_ammobox_supply_07; +class vn_b_ammobox_supply_09: vn_b_ammobox_supply_07 { // just a pallet + XEH_INHERITED; +}; +class vn_object_c_base_02; +class Land_vn_canisterfuel_f: vn_object_c_base_02 { + EGVAR(cargo,size) = 1; + EGVAR(cargo,canLoad) = 1; + EGVAR(cargo,noRename) = 1; +}; +class Land_vn_object_c_base; +class Land_vn_fuelcan: Land_vn_object_c_base { + XEH_INHERITED; + EGVAR(cargo,size) = 1; + EGVAR(cargo,canLoad) = 1; + EGVAR(cargo,noRename) = 1; +}; diff --git a/addons/compat_sog/config.cpp b/addons/compat_sog/config.cpp index 62b235773b..04db68293c 100644 --- a/addons/compat_sog/config.cpp +++ b/addons/compat_sog/config.cpp @@ -1,5 +1,4 @@ #include "script_component.hpp" -// ToDo: move refuel to subconfig #include "\z\ace\addons\refuel\defines.hpp" #include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp" @@ -47,6 +46,8 @@ class CfgPatches { }; }; +class CBA_Extended_EventHandlers; + #include "ACE_CSW_Groups.hpp" #include "ACE_Medical_Injuries.hpp" #include "ACE_Triggers.hpp" diff --git a/addons/compat_spe/compat_spe_refuel/CfgVehicles.hpp b/addons/compat_spe/compat_spe_refuel/CfgVehicles.hpp index f47d6877f7..fc1ebc9b4e 100644 --- a/addons/compat_spe/compat_spe_refuel/CfgVehicles.hpp +++ b/addons/compat_spe/compat_spe_refuel/CfgVehicles.hpp @@ -1,13 +1,11 @@ class CfgVehicles { class SPE_Halftrack_base; class SPE_US_M3_Halftrack_Fuel: SPE_Halftrack_base { - transportFuel = 0; EGVAR(refuel,hooks)[] = {{-0.23,-2.58,-0.59}}; EGVAR(refuel,fuelCargo) = 2000; }; class SPE_OpelBlitz_base; class SPE_OpelBlitz_Fuel: SPE_OpelBlitz_base { - transportFuel = 0; EGVAR(refuel,hooks)[] = {{-0.23,-2.58,-0.59}}; EGVAR(refuel,fuelCargo) = 2000; }; diff --git a/addons/refuel/ACE_Refuel_Positions.hpp b/addons/refuel/ACE_Refuel_Positions.hpp index cb03f53247..78af5b6d48 100644 --- a/addons/refuel/ACE_Refuel_Positions.hpp +++ b/addons/refuel/ACE_Refuel_Positions.hpp @@ -31,7 +31,7 @@ class GVAR(positions) { intro[] = { /* CUP Rahmadi */ }; sara[] = { /* CUP Sahrani */ {"Land_Benzina_schnell", {{8473,9423,0},{9227,5840,0},{9433,5187,0},{10168,6423,0},{10932,9475,0},{11233,6114,0},{11756,10227,0},{12289,6833,0}}}, - {"Land_Fuelstation_army", {{9568,9819,0},{19294,13879,0}}}, + {"Land_Fuelstation_army", {{9568,9819,0},{19294,13879,0}}} }; sara_dbe1[] = { /* CUP United Sahrani */ {"Land_Benzina_schnell", {{8473,9423,0},{9227,5840,0},{9433,5187,0},{10168,6423,0},{10932,9475,0},{11233,6114,0},{11756,10227,0},{12289,6833,0}}}, @@ -87,4 +87,10 @@ class GVAR(positions) { {"Land_FuelStation_01_pump_malevil_F", {{18039,18139,0}}}, {"Land_FuelStation_Feed_F", {{756,12133,0},{1239,7346,0},{1726,17469,0},{3113,10070,0},{3828,8362,0},{5668,16967,0},{7435,14185,0},{7543,12107,0},{8366,6086,0},{9672,9586,0},{11749,12255,0},{12802,10022,0},{13989,3591,0},{15198,10900,0},{19063,1654,0},{19378,18517,0}}} }; + pabst_yellowstone[] = { /* Yellowstone */ + {"Land_fs_feed_F", {{3075,7426,0},{7060,3626,0},{7950,4060,0},{7974,4072,0}}}, + {"Land_FuelStation_01_pump_F", {{4565,1953,0}}}, + {"Land_FuelStation_01_pump_malevil_F", {{7072,3676,0}}}, + {"Land_FuelStation_Feed_F", {{4678,3971,0},{6391,5174,0}}} + }; }; diff --git a/addons/refuel/dev/exportTerrainRefuelPositions.sqf b/addons/refuel/dev/exportTerrainRefuelPositions.sqf index 72b60a3f1c..c7f9abfb2f 100644 --- a/addons/refuel/dev/exportTerrainRefuelPositions.sqf +++ b/addons/refuel/dev/exportTerrainRefuelPositions.sqf @@ -3,6 +3,14 @@ #include "\z\ace\addons\refuel\script_component.hpp" +{ + if (!isArray (configFile >> QGVAR(positions) >> configName _x)) then { + WARNING_1("need configs on [%1]",configName _x); + }; +} forEach ("true" configClasses (configFile >> "CfgWorldList")); + + + private _basePumps = []; private _totalCount = 0; private _posCount = 0; @@ -47,9 +55,12 @@ _basePumps sort true; // sort pump classes alphabetically private _checkCount = 0; { _x params ["_class", "_positions"]; + private _pumps = []; { - _checkCount = _checkCount + count (_x nearObjects [_class, 30]); + _pumps append (_x nearObjects [_class, 30]); } forEach _positions; + _pumps = _pumps arrayIntersect _pumps; + _checkCount = _checkCount + count _pumps; } forEach _basePumps; if (_checkCount != _totalCount) then { _message = "WRONG COUNT " + str _checkCount;