From b978b3695f464408e8f85143efb8417734030728 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Sun, 13 Sep 2026 16:45:56 +0800 Subject: [PATCH 01/12] convert hooks to khook --- AMBuildScript | 21 +++++++++++++++++++-- cssdm_events.cpp | 20 ++++++++++++++++++++ cssdm_ffa.cpp | 27 +++++++++++++++++++++++++++ cssdm_main.cpp | 27 +++++++++++++++++++++++++++ 4 files changed, 93 insertions(+), 2 deletions(-) diff --git a/AMBuildScript b/AMBuildScript index dc15304..19a4e25 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -1,5 +1,6 @@ # vim: set ts=2 sw=2 tw=99 noet ft=python: import os +import re import platform def ResolveEnvPath(env, folder): @@ -396,10 +397,15 @@ class ExtensionConfig(object): SetArchFlags(compiler) compiler.cxxincludes += [ - os.path.join(self.mms_root, 'core'), - os.path.join(self.mms_root, 'core', 'sourcehook'), + os.path.join(self.mms_root, 'core') ] + mms_major = int(self.get_mms_version()[0]) + if mms_major >= 2: + compiler.cxxincludes += [os.path.join(self.mms_root, 'third_party', 'khook', 'include')] + else: + compiler.cxxincludes += [os.path.join(self.mms_root, 'core', 'sourcehook')] + for other_sdk in self.sdk_manifests: compiler.defines += [f'SE_{other_sdk["define"]}={other_sdk["code"]}'] @@ -443,6 +449,17 @@ class ExtensionConfig(object): else: raise Exception("Could not find a suitable copy of spcomp in SourceMod binary root") + def get_mms_version(self): + mms_version_file = os.path.join(self.mms_root, "product.version") + if not os.path.isfile(mms_version_file): + raise Exception("Could not find product.version under Metamod:Source root") + with open(mms_version_file, "r") as f: + version = f.read().strip() + match = re.match(r'([0-9]+).([0-9]+).([0-9]+).*', version) + if match: + return match.groups() + raise Exception("Could parse product.version from Metamod:Source") + Extension = ExtensionConfig() Extension.detectSDKs() Extension.find_spcomp() diff --git a/cssdm_events.cpp b/cssdm_events.cpp index 2db2434..947b685 100644 --- a/cssdm_events.cpp +++ b/cssdm_events.cpp @@ -145,11 +145,19 @@ void DM_SchedRespawn(int client) player->respawn_timer = timersys->CreateTimer(&s_PlayerSpawner, DM_GetRespawnWait(), data, 0); } +#if METAMOD_PLAPI_VERSION < 18 void OnClientCommand_Post(edict_t *edict, const CCommand &args) +#else +KHook::Return OnClientCommand_Post(IServerGameClients *gameClients, edict_t *edict, const CCommand &args) +#endif { if (!g_IsRunning) { +#if METAMOD_PLAPI_VERSION < 18 return; +#else + return { KHook::Action::Ignore }; +#endif } const char *cmd = args.Arg(0); @@ -160,17 +168,29 @@ void OnClientCommand_Post(edict_t *edict, const CCommand &args) dm_player_t *player = DM_GetPlayer(client); if (!player || !player->pEntity) { +#if METAMOD_PLAPI_VERSION < 18 return; +#else + return { KHook::Action::Ignore }; +#endif } if (DM_IsPlayerAlive(client)) { +#if METAMOD_PLAPI_VERSION < 18 return; +#else + return { KHook::Action::Ignore }; +#endif } if (!player->will_respawn_on_class) { +#if METAMOD_PLAPI_VERSION < 18 return; +#else + return { KHook::Action::Ignore }; +#endif } player->will_respawn_on_class = false; diff --git a/cssdm_ffa.cpp b/cssdm_ffa.cpp index 56154de..7e4c239 100644 --- a/cssdm_ffa.cpp +++ b/cssdm_ffa.cpp @@ -32,7 +32,14 @@ // Don't patch anything on CSGO #if SOURCE_ENGINE != SE_CSGO +#if METAMOD_PLAPI_VERSION < 18 SH_DECL_MANUALHOOK2(CGameRules_IPointsForKill, 62+EXTRA_VTBL_OFFSET, 0, 0, int, CBasePlayer *, CBasePlayer *); +#else +class CGameRules; +KHook::Return OnIPointsForKill(CGameRules *gamerules, CBasePlayer *pl1, CBasePlayer *pl2); + +KHook::Virtual Hook_IPointsForKill(62 + EXTRA_VTBL_OFFSET, nullptr, OnIPointsForKill); +#endif #if defined PLATFORM_64BITS #define PLATFORM_ARCH_SUFFIX "64" @@ -72,10 +79,18 @@ static void *g_domrev_addr = NULL; static dmpatch_t g_domrev_patch; static dmpatch_t g_domrev_restore; +#if METAMOD_PLAPI_VERSION < 18 int OnIPointsForKill(CBasePlayer *pl1, CBasePlayer *pl2) +#else +KHook::Return OnIPointsForKill(CGameRules *gamerules, CBasePlayer *pl1, CBasePlayer *pl2) +#endif { /* If we're hooked, FFA is always on. */ +#if METAMOD_PLAPI_VERSION < 18 RETURN_META_VALUE(MRES_SUPERCEDE, 1); +#else + return { KHook::Action::Supersede, 1 }; +#endif } bool DM_FFA_LoadPatch(const char *name, dmpatch_t *patch, char *error, size_t maxlength) @@ -168,7 +183,11 @@ bool DM_Prepare_FFA(char *error, size_t maxlength) snprintf(error, maxlength, "Could not find IPointsForKills offset"); return false; } +#if METAMOD_PLAPI_VERSION < 18 SH_MANUALHOOK_RECONFIGURE(CGameRules_IPointsForKill, offset, 0, 0); +#else + Hook_IPointsForKill.Configure(offset); +#endif g_FFA_Prepared = true; @@ -205,7 +224,11 @@ bool DM_Patch_FFA() // needs a new gamerules address on every map load if (!g_FFA_PointsHooked && LoadGameRulesAddress()) { +#if METAMOD_PLAPI_VERSION < 18 SH_ADD_MANUALHOOK_STATICFUNC(CGameRules_IPointsForKill, g_gamerules_addr, OnIPointsForKill, false); +#else + Hook_IPointsForKill.Add(reinterpret_cast(g_gamerules_addr)); +#endif g_FFA_PointsHooked = true; } @@ -224,7 +247,11 @@ bool DM_Unpatch_FFA() // g_gamerules_addr won't be null if we're already hooked if (!g_IsInGlobalShutdown && g_FFA_PointsHooked) { +#if METAMOD_PLAPI_VERSION < 18 SH_REMOVE_MANUALHOOK_STATICFUNC(CGameRules_IPointsForKill, g_gamerules_addr, OnIPointsForKill, false); +#else + Hook_IPointsForKill.Remove(reinterpret_cast(g_gamerules_addr)); +#endif g_FFA_PointsHooked = false; } diff --git a/cssdm_main.cpp b/cssdm_main.cpp index 75d4c0c..50a2c9b 100644 --- a/cssdm_main.cpp +++ b/cssdm_main.cpp @@ -36,8 +36,17 @@ #include "cssdm_weapons.h" #include "cssdm_version.h" +#if METAMOD_PLAPI_VERSION < 18 SH_DECL_HOOK0_void(IServerGameDLL, DLLShutdown, SH_NOATTRIB, false); SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, false, edict_t *, const CCommand &); +#else +KHook::Return OnDLLShutdown(IServerGameDLL *server); +KHook::Return OnClientCommand_Post(IServerGameClients *gameClients, edict_t *edict, const CCommand &args); + +KHook::Virtual Hook_DLLShutdown(&IServerGameDLL::DLLShutdown, nullptr, OnDLLShutdown); +KHook::Virtual Hook_ClientCommand( + &IServerGameClients::ClientCommand, nullptr, OnClientCommand_Post); +#endif Deathmatch g_DM; IGameEventManager2 *gameevents = NULL; @@ -122,10 +131,18 @@ bool Deathmatch::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bo return true; } +#if METAMOD_PLAPI_VERSION < 18 void OnDLLShutdown() +#else +KHook::Return OnDLLShutdown(IServerGameDLL *server) +#endif { g_IsInGlobalShutdown = true; +#if METAMOD_PLAPI_VERSION < 18 RETURN_META(MRES_IGNORED); +#else + return { KHook::Action::Ignore }; +#endif } bool Startup(char *error, size_t maxlength) @@ -141,8 +158,13 @@ bool Startup(char *error, size_t maxlength) g_Startup = true; +#if METAMOD_PLAPI_VERSION < 18 SH_ADD_HOOK_STATICFUNC(IServerGameDLL, DLLShutdown, gamedll, OnDLLShutdown, false); SH_ADD_HOOK_STATICFUNC(IServerGameClients, ClientCommand, gameclients, OnClientCommand_Post, true); +#else + Hook_DLLShutdown.Add(gamedll); + Hook_ClientCommand.Add(gameclients); +#endif DM_InitCallbacks(); @@ -184,8 +206,13 @@ void Shutdown() ShutdownUtils(); /* Unhook everything from SourceHook */ +#if METAMOD_PLAPI_VERSION < 18 SH_REMOVE_HOOK_STATICFUNC(IServerGameClients, ClientCommand, gameclients, OnClientCommand_Post, true); SH_REMOVE_HOOK_STATICFUNC(IServerGameDLL, DLLShutdown, gamedll, OnDLLShutdown, false); +#else + Hook_ClientCommand.Remove(gameclients); + Hook_DLLShutdown.Remove(gamedll); +#endif } void Deathmatch::SDK_OnAllLoaded() From 4b8615a83fa46ee55a753298ea001683f54718da Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Mon, 14 Sep 2026 00:02:15 +0800 Subject: [PATCH 02/12] use goto for OnClientCommand_Post cleanup --- cssdm_events.cpp | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/cssdm_events.cpp b/cssdm_events.cpp index 9071f0b..eec5a42 100644 --- a/cssdm_events.cpp +++ b/cssdm_events.cpp @@ -150,16 +150,14 @@ void OnClientCommand_Post(edict_t *edict, const CCommand &args) KHook::Return OnClientCommand_Post(IServerGameClients *gameClients, edict_t *edict, const CCommand &args) #endif { + const char *cmd; + if (!g_IsRunning) { -#if METAMOD_PLAPI_VERSION < 18 - return; -#else - return { KHook::Action::Ignore }; -#endif + goto end; } - const char *cmd = args.Arg(0); + cmd = args.Arg(0); if (strcmp(cmd, "joinclass") == 0) { @@ -167,29 +165,17 @@ KHook::Return OnClientCommand_Post(IServerGameClients *gameClients, edict_ dm_player_t *player = DM_GetPlayer(client); if (!player || !player->pEntity) { -#if METAMOD_PLAPI_VERSION < 18 - return; -#else - return { KHook::Action::Ignore }; -#endif + goto end; } if (DM_IsPlayerAlive(client)) { -#if METAMOD_PLAPI_VERSION < 18 - return; -#else - return { KHook::Action::Ignore }; -#endif + goto end; } if (!player->will_respawn_on_class) { -#if METAMOD_PLAPI_VERSION < 18 - return; -#else - return { KHook::Action::Ignore }; -#endif + goto end; } player->will_respawn_on_class = false; @@ -197,6 +183,13 @@ KHook::Return OnClientCommand_Post(IServerGameClients *gameClients, edict_ /* Respawn! */ DM_SchedRespawn(client); } + +end: +#if METAMOD_PLAPI_VERSION < 18 + RETURN_META(MRES_IGNORED); +#else + return { KHook::Action::Ignore }; +#endif } #define IMPLEMENT_EVENT(name) \ From d8461702ee66f49b3adce7016e07c82eef76209a Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Mon, 14 Sep 2026 00:15:35 +0800 Subject: [PATCH 03/12] fix typo in build script --- AMBuildScript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AMBuildScript b/AMBuildScript index 082906f..d605ec9 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -462,7 +462,7 @@ class ExtensionConfig(object): match = re.match(r'([0-9]+).([0-9]+).([0-9]+).*', version) if match: return match.groups() - raise Exception("Could parse product.version from Metamod:Source") + raise Exception("Could not parse product.version from Metamod:Source") Extension = ExtensionConfig() Extension.detectSDKs() From e8c95d96113df3b3b00e95845724d24bef091703 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Mon, 14 Sep 2026 00:31:35 +0800 Subject: [PATCH 04/12] make DM_SetMemPatchable work with khook --- cssdm_utils.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cssdm_utils.cpp b/cssdm_utils.cpp index 9189906..6c52ed8 100644 --- a/cssdm_utils.cpp +++ b/cssdm_utils.cpp @@ -30,7 +30,11 @@ #include "cssdm_players.h" #include "cssdm_utils.h" #include "cssdm_includesdk.h" +#if METAMOD_PLAPI_VERSION < 18 #include +#else +#include +#endif std::list g_CallWrappers; ICallWrapper *g_pRoundRespawn = NULL; @@ -240,7 +244,11 @@ void DM_ApplyPatch(void *address, int offset, const dmpatch_t *patch, dmpatch_t void DM_SetMemPatchable(void *address, size_t size) { +#if METAMOD_PLAPI_VERSION < 18 SourceHook::SetMemAccess(address, size, SH_MEM_READ|SH_MEM_WRITE|SH_MEM_EXEC); +#else + KHook::Memory::SetAccess(address, size, KHook::Memory::Flags::READ | KHook::Memory::Flags::WRITE | KHook::Memory::EXECUTE); +#endif } #define GET_PROPERTY(cls, name, var) \ From 3dd67c1f9c039975832eef80b7872d26de281ec5 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Mon, 14 Sep 2026 00:32:03 +0800 Subject: [PATCH 05/12] only set memory access on the bytes we need --- cssdm_utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cssdm_utils.cpp b/cssdm_utils.cpp index 6c52ed8..6145061 100644 --- a/cssdm_utils.cpp +++ b/cssdm_utils.cpp @@ -225,7 +225,7 @@ void DM_ApplyPatch(void *address, int offset, const dmpatch_t *patch, dmpatch_t { unsigned char *addr = (unsigned char *)address + offset; - DM_SetMemPatchable(addr, 20); + DM_SetMemPatchable(addr, patch->bytes); if (restore) { From 3ba852ce4148dca73c4dd762ccb782405e287f2c Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Mon, 14 Sep 2026 10:11:25 +0800 Subject: [PATCH 06/12] update function declaration in cssdm_events.h --- cssdm_events.h | 4 ++++ cssdm_main.cpp | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cssdm_events.h b/cssdm_events.h index 22321a8..6ce8324 100644 --- a/cssdm_events.h +++ b/cssdm_events.h @@ -60,7 +60,11 @@ DECLARE_EVENT(round_end); class CCommand; void DM_ClearRagdollTimers(); +#if METAMOD_PLAPI_VERSION < 18 void OnClientCommand_Post(edict_t *edict, const CCommand &args); +#else +KHook::Return OnClientCommand_Post(IServerGameClients *gameClients, edict_t *edict, const CCommand &args); +#endif class DMData { diff --git a/cssdm_main.cpp b/cssdm_main.cpp index 50a2c9b..1c82538 100644 --- a/cssdm_main.cpp +++ b/cssdm_main.cpp @@ -41,7 +41,6 @@ SH_DECL_HOOK0_void(IServerGameDLL, DLLShutdown, SH_NOATTRIB, false); SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, false, edict_t *, const CCommand &); #else KHook::Return OnDLLShutdown(IServerGameDLL *server); -KHook::Return OnClientCommand_Post(IServerGameClients *gameClients, edict_t *edict, const CCommand &args); KHook::Virtual Hook_DLLShutdown(&IServerGameDLL::DLLShutdown, nullptr, OnDLLShutdown); KHook::Virtual Hook_ClientCommand( From 354021750cb35709ef11e3c0010852d1658b477e Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Mon, 14 Sep 2026 10:13:51 +0800 Subject: [PATCH 07/12] move declaration of Hook_IPointsForKill --- cssdm_ffa.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cssdm_ffa.cpp b/cssdm_ffa.cpp index 7e4c239..45c01ba 100644 --- a/cssdm_ffa.cpp +++ b/cssdm_ffa.cpp @@ -36,9 +36,6 @@ SH_DECL_MANUALHOOK2(CGameRules_IPointsForKill, 62+EXTRA_VTBL_OFFSET, 0, 0, int, CBasePlayer *, CBasePlayer *); #else class CGameRules; -KHook::Return OnIPointsForKill(CGameRules *gamerules, CBasePlayer *pl1, CBasePlayer *pl2); - -KHook::Virtual Hook_IPointsForKill(62 + EXTRA_VTBL_OFFSET, nullptr, OnIPointsForKill); #endif #if defined PLATFORM_64BITS @@ -93,6 +90,10 @@ KHook::Return OnIPointsForKill(CGameRules *gamerules, CBasePlayer *pl1, CBa #endif } +#if METAMOD_PLAPI_VERSION >= 18 +KHook::Virtual Hook_IPointsForKill(62 + EXTRA_VTBL_OFFSET, nullptr, OnIPointsForKill); +#endif + bool DM_FFA_LoadPatch(const char *name, dmpatch_t *patch, char *error, size_t maxlength) { char fullname[255]; From c635ba2ee1d612c39375fc5587516c06d696d1f6 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Mon, 14 Sep 2026 10:15:34 +0800 Subject: [PATCH 08/12] update the offset in cssdm_ffa as well --- cssdm_ffa.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cssdm_ffa.cpp b/cssdm_ffa.cpp index 45c01ba..4a08a1e 100644 --- a/cssdm_ffa.cpp +++ b/cssdm_ffa.cpp @@ -33,7 +33,7 @@ // Don't patch anything on CSGO #if SOURCE_ENGINE != SE_CSGO #if METAMOD_PLAPI_VERSION < 18 -SH_DECL_MANUALHOOK2(CGameRules_IPointsForKill, 62+EXTRA_VTBL_OFFSET, 0, 0, int, CBasePlayer *, CBasePlayer *); +SH_DECL_MANUALHOOK2(CGameRules_IPointsForKill, 80+EXTRA_VTBL_OFFSET, 0, 0, int, CBasePlayer *, CBasePlayer *); #else class CGameRules; #endif @@ -91,7 +91,7 @@ KHook::Return OnIPointsForKill(CGameRules *gamerules, CBasePlayer *pl1, CBa } #if METAMOD_PLAPI_VERSION >= 18 -KHook::Virtual Hook_IPointsForKill(62 + EXTRA_VTBL_OFFSET, nullptr, OnIPointsForKill); +KHook::Virtual Hook_IPointsForKill(80 + EXTRA_VTBL_OFFSET, nullptr, OnIPointsForKill); #endif bool DM_FFA_LoadPatch(const char *name, dmpatch_t *patch, char *error, size_t maxlength) From 116fcf2b347fb6c0f5887a5d52614b17f9e0f454 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Mon, 14 Sep 2026 10:25:13 +0800 Subject: [PATCH 09/12] remove undefined function --- cssdm_utils.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/cssdm_utils.cpp b/cssdm_utils.cpp index 6145061..91f9e07 100644 --- a/cssdm_utils.cpp +++ b/cssdm_utils.cpp @@ -43,8 +43,6 @@ ICallWrapper *g_pGiveAmmo = NULL; int g_RagdollOffset = 0; int g_LifeStateOffset = 0; -void DM_ProtectMemory(void *addr, int length, int prot); - CBaseEntity *DM_GetBaseEntity(int index) { edict_t *pEdict = gamehelpers->EdictOfIndex(index); From bec5cc575d031a7d871ef7641911aa8d9a283ab6 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Mon, 14 Sep 2026 10:45:30 +0800 Subject: [PATCH 10/12] move definition of khook hooks --- cssdm_main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cssdm_main.cpp b/cssdm_main.cpp index 1c82538..b929657 100644 --- a/cssdm_main.cpp +++ b/cssdm_main.cpp @@ -39,12 +39,6 @@ #if METAMOD_PLAPI_VERSION < 18 SH_DECL_HOOK0_void(IServerGameDLL, DLLShutdown, SH_NOATTRIB, false); SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, false, edict_t *, const CCommand &); -#else -KHook::Return OnDLLShutdown(IServerGameDLL *server); - -KHook::Virtual Hook_DLLShutdown(&IServerGameDLL::DLLShutdown, nullptr, OnDLLShutdown); -KHook::Virtual Hook_ClientCommand( - &IServerGameClients::ClientCommand, nullptr, OnClientCommand_Post); #endif Deathmatch g_DM; @@ -144,6 +138,12 @@ KHook::Return OnDLLShutdown(IServerGameDLL *server) #endif } +#if METAMOD_PLAPI_VERSION >= 18 +KHook::Virtual Hook_DLLShutdown(&IServerGameDLL::DLLShutdown, nullptr, OnDLLShutdown); +KHook::Virtual Hook_ClientCommand( + &IServerGameClients::ClientCommand, nullptr, OnClientCommand_Post); +#endif + bool Startup(char *error, size_t maxlength) { playerhelpers->AddClientListener(&g_ClientListener); From 4d9336006970238a9219b703f9fbb3ef79f13613 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Mon, 14 Sep 2026 10:46:05 +0800 Subject: [PATCH 11/12] add mms_branch variable in sm matrix for ci --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b2f5ed..a5f94f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,8 +36,10 @@ jobs: sm: - label: "1.12" branch: "1.12-dev" + mms_branch: "1.12-dev" - label: "1.13" branch: "master" + mms_branch: "1.12-dev" target: - os: ubuntu-latest os_name: linux @@ -91,7 +93,7 @@ jobs: uses: actions/checkout@v7 with: repository: alliedmodders/metamod-source - ref: 1.12-dev + ref: ${{ matrix.sm.mms_branch }} path: mmsource submodules: recursive From 675ab1eb1259b1984ea91c8ede7d5e46c7ed6a71 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Tue, 15 Sep 2026 08:56:23 +0800 Subject: [PATCH 12/12] make dllshutdown and ipointsforkill pre hooks --- cssdm_ffa.cpp | 2 +- cssdm_main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cssdm_ffa.cpp b/cssdm_ffa.cpp index 4a08a1e..d44397b 100644 --- a/cssdm_ffa.cpp +++ b/cssdm_ffa.cpp @@ -91,7 +91,7 @@ KHook::Return OnIPointsForKill(CGameRules *gamerules, CBasePlayer *pl1, CBa } #if METAMOD_PLAPI_VERSION >= 18 -KHook::Virtual Hook_IPointsForKill(80 + EXTRA_VTBL_OFFSET, nullptr, OnIPointsForKill); +KHook::Virtual Hook_IPointsForKill(80 + EXTRA_VTBL_OFFSET, OnIPointsForKill, nullptr); #endif bool DM_FFA_LoadPatch(const char *name, dmpatch_t *patch, char *error, size_t maxlength) diff --git a/cssdm_main.cpp b/cssdm_main.cpp index b929657..f094b4a 100644 --- a/cssdm_main.cpp +++ b/cssdm_main.cpp @@ -139,7 +139,7 @@ KHook::Return OnDLLShutdown(IServerGameDLL *server) } #if METAMOD_PLAPI_VERSION >= 18 -KHook::Virtual Hook_DLLShutdown(&IServerGameDLL::DLLShutdown, nullptr, OnDLLShutdown); +KHook::Virtual Hook_DLLShutdown(&IServerGameDLL::DLLShutdown, OnDLLShutdown, nullptr); KHook::Virtual Hook_ClientCommand( &IServerGameClients::ClientCommand, nullptr, OnClientCommand_Post); #endif