diff -r 2c56e1550aaa -r 7e8bf503bc9e extensions/tf2/extension.cpp --- a/extensions/tf2/extension.cpp Tue Jul 01 06:13:09 2008 +0000 +++ b/extensions/tf2/extension.cpp Tue Jul 01 09:04:00 2008 +0000 @@ -35,6 +35,7 @@ #include "iplayerinfo.h" #include "sm_trie_tpl.h" #include "criticals.h" +#include "CDetour/detours.h" /** * @file extension.cpp @@ -96,12 +97,14 @@ return false; } + CDetourManager::Init(g_pSM->GetScriptingEngine(), g_pGameConf); + sharesys->AddNatives(myself, g_TFNatives); sharesys->RegisterLibrary(myself, "tf2"); playerhelpers->RegisterCommandTargetProcessor(this); - spengine = g_pSM->GetScriptingEngine(); + g_critForward = forwards->CreateForward("TF2_CalcIsAttackCritical", ET_Hook, 4, NULL, Param_Cell, Param_Cell, Param_String, Param_CellByRef); g_pCVar = icvar; @@ -133,13 +136,17 @@ g_RegNatives.UnregisterAll(); gameconfs->CloseGameConfigFile(g_pGameConf); playerhelpers->UnregisterCommandTargetProcessor(this); + + forwards->ReleaseForward(g_critForward); + + RemoveDetours(); } void TF2Tools::SDK_OnAllLoaded() { SM_GET_LATE_IFACE(BINTOOLS, g_pBinTools); - g_CriticalHitManager.Init(); + InitialiseDetours(); } bool TF2Tools::RegisterConCommandBase(ConCommandBase *pVar)