Fix missing refuel menu on static fuel stations (#4533)

* fix static fuel stations

* Directly compile menus and remove XEH from buildings
This commit is contained in:
Dystopian 2016-12-14 21:48:00 +03:00 committed by PabstMirror
parent 2151fcad8f
commit cc3b669fcd
2 changed files with 15 additions and 11 deletions

View File

@ -144,13 +144,11 @@ class CfgVehicles {
class House_F: House {};
class House_Small_F: House_F {
class EventHandlers;
class ACE_Actions {
class ACE_MainActions {
displayName = ECSTRING(interaction,MainAction);
selection = "";
distance = 10;
distance = 5;
condition = "true";
};
};
@ -501,10 +499,6 @@ class CfgVehicles {
// Vanilla buildings
class Land_Fuelstation_Feed_F: House_Small_F {
class EventHandlers {
class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {};
};
transportFuel = 0; //50k
MACRO_REFUEL_ACTIONS
GVAR(hooks)[] = {{0,0,-0.5}};
@ -512,10 +506,6 @@ class CfgVehicles {
};
class Land_fs_feed_F: House_Small_F {
class EventHandlers {
class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {};
};
transportFuel = 0; //50k
MACRO_REFUEL_ACTIONS
GVAR(hooks)[] = {{-0.4,0.022,-.23}};

View File

@ -11,6 +11,20 @@ if (isServer) then {
_this call FUNC(resetLocal);
}] call CBA_fnc_addEventHandler;
// workaround for static fuel stations
if (hasInterface) then {
{
if (
configName _x isKindOf "Building" &&
{isClass (_x >> "ACE_Actions" >> "ACE_MainActions" >> QGVAR(Refuel))} &&
{getNumber (_x >> "scope") == 2}
) then {
TRACE_1("Compiling menu",configName _x);
[configName _x] call EFUNC(interact_menu,compileMenu);
};
} count ('true' configClasses (configFile >> "CfgVehicles"));
};
#ifdef DEBUG_MODE_FULL
diag_log text format ["[ACE-refuel] Showing CfgVehicles with vanilla transportFuel"];