Skip to content

Commit

Permalink
Hearing - Use class EH instead of extended EH (#9986)
Browse files Browse the repository at this point in the history
Use class EH instead of extended EH
  • Loading branch information
johnb432 authored Apr 28, 2024
1 parent 60b87f0 commit 3b80629
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 1 addition & 9 deletions addons/hearing/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,7 @@ class Extended_PreInit_EventHandlers {

class Extended_PostInit_EventHandlers {
class ADDON {
clientinit = QUOTE(call COMPILE_SCRIPT(XEH_postInit));
};
};

class Extended_Init_EventHandlers {
class CAManBase {
class GVAR(AddEarPlugs) {
serverInit = QUOTE(_this call FUNC(addEarPlugs));
};
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit));
};
};

Expand Down
10 changes: 10 additions & 0 deletions addons/hearing/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#include "script_component.hpp"

if (isServer) then {
["CBA_settingsInitialized", {
TRACE_1("settingInit - server",GVAR(EnableCombatDeafness));
// Only install event handler if combat deafness is enabled
if (!GVAR(EnableCombatDeafness)) exitWith {};

["CAManBase", "Init", LINKFUNC(addEarPlugs), true, [], true] call CBA_fnc_addClassEventHandler;
}] call CBA_fnc_addEventHandler;
};

if (!hasInterface) exitWith {};

#include "initKeybinds.inc.sqf"
Expand Down

0 comments on commit 3b80629

Please sign in to comment.