From c47896232c834d3b6c29fe94f42930793e66668e Mon Sep 17 00:00:00 2001 From: Arkshine Date: Sun, 1 Feb 2015 20:43:06 +0100 Subject: [PATCH] CStrike: Fix crash --- dlls/cstrike/cstrike/amxx_api.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/cstrike/cstrike/amxx_api.cpp b/dlls/cstrike/cstrike/amxx_api.cpp index 1cf5c169..8f907bc1 100644 --- a/dlls/cstrike/cstrike/amxx_api.cpp +++ b/dlls/cstrike/cstrike/amxx_api.cpp @@ -61,9 +61,6 @@ void OnAmxxAttach() { MF_Log("UTIL_FindEntByString is not available - native cs_find_ent_by_class() has been disabled"); } - - // Search pev offset automatically. - G_OffsetHandler = new OffsetHandler; } void OnPluginsLoaded() @@ -81,6 +78,12 @@ void OnPluginsLoaded() // And enable/disable detours when necessary. ToggleDetour_ClientCommands(ForwardInternalCommand != -1 || ForwardOnBuy != -1 || ForwardOnBuy != -1); ToggleDetour_BuyCommands(ForwardOnBuy != -1); + + // Search pev offset automatically. + if (!G_OffsetHandler) + { + G_OffsetHandler = new OffsetHandler; + } } void OnAmxxDetach()