Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hearing - Use class EH instead of extended EH #9986

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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