From a8b4ebbe70046b5c09fdf0a17a7bb401b6b56629 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 18 Aug 2006 22:17:51 +0000 Subject: [PATCH] Fixed bug am42097 (FM disabling hooks too early) --- dlls/fakemeta/fakemeta_amxx.cpp | 4 ++-- dlls/fakemeta/sdk/moduleconfig.h | 4 ++-- plugins/testsuite/fakemeta_tests.sma | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 plugins/testsuite/fakemeta_tests.sma diff --git a/dlls/fakemeta/fakemeta_amxx.cpp b/dlls/fakemeta/fakemeta_amxx.cpp index 0a5c5a46..13194d77 100755 --- a/dlls/fakemeta/fakemeta_amxx.cpp +++ b/dlls/fakemeta/fakemeta_amxx.cpp @@ -27,7 +27,7 @@ void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax) { for(int i = 1; i <= gpGlobals->maxClients;i++) g_player_edicts[i]=pEdictList + i; - g_pFunctionTable->pfnServerDeactivate = FMH_ServerDeactivate; + g_pFunctionTable_Post->pfnServerDeactivate = FMH_ServerDeactivate_Post; RETURN_META(MRES_IGNORED); } #define RESETD(tcall) \ @@ -48,7 +48,7 @@ void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax) Engine[FM_##call].clear(); \ EnginePost[FM_##call].clear(); -void FMH_ServerDeactivate() +void FMH_ServerDeactivate_Post() { // Reset all call lists here. // NULL all function tables diff --git a/dlls/fakemeta/sdk/moduleconfig.h b/dlls/fakemeta/sdk/moduleconfig.h index 875e72c0..5c6f3782 100755 --- a/dlls/fakemeta/sdk/moduleconfig.h +++ b/dlls/fakemeta/sdk/moduleconfig.h @@ -105,7 +105,7 @@ // #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */ // #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */ #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */ -#define FN_ServerDeactivate FMH_ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */ +// #define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */ // #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */ // #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */ // #define FN_StartFrame StartFrame /* pfnStartFrame() */ @@ -157,7 +157,7 @@ // #define FN_ClientCommand_Post ClientCommand_Post // #define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post // #define FN_ServerActivate_Post ServerActivate_Post -// #define FN_ServerDeactivate_Post ServerDeactivate_Post +#define FN_ServerDeactivate_Post FMH_ServerDeactivate_Post // #define FN_PlayerPreThink_Post PlayerPreThink_Post // #define FN_PlayerPostThink_Post PlayerPostThink_Post // #define FN_StartFrame_Post StartFrame_Post diff --git a/plugins/testsuite/fakemeta_tests.sma b/plugins/testsuite/fakemeta_tests.sma new file mode 100644 index 00000000..c7843a8c --- /dev/null +++ b/plugins/testsuite/fakemeta_tests.sma @@ -0,0 +1,18 @@ +#include +#include + +public plugin_init() +{ + register_plugin("Fakemeta Tests", "1.0", "BAILOPAN") + register_forward(FM_ServerDeactivate, "Hook_ServerDeactivate") +} + +public Hook_ServerDeactivate() +{ + server_print("[FAKEMETA TEST] ServerDeactivate() at %f", get_gametime()) +} + +public plugin_end() +{ + server_print("[FAKEMETA TEST] plugin_end() at %f", get_gametime()) +}