From 7c31fdc87b0f33089924c9f5eb3f334899346655 Mon Sep 17 00:00:00 2001 From: LivingInPortal Date: Fri, 12 Feb 2016 12:03:00 +0800 Subject: [PATCH] Fix undefined gpGlobals --- extension.cpp | 8 ++++++++ extension.h | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/extension.cpp b/extension.cpp index 6e1c964..26f2d0a 100644 --- a/extension.cpp +++ b/extension.cpp @@ -36,6 +36,8 @@ * @brief Implement extension code here. */ +CGlobalVars *gpGlobals = NULL; + Outputinfo g_Outputinfo; /**< Global singleton for extension's main interface */ SMEXT_LINK(&g_Outputinfo); @@ -310,3 +312,9 @@ void Outputinfo::SDK_OnAllLoaded() { sharesys->AddNatives(myself, MyNatives); } + +bool Outputinfo::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlength, bool late) +{ + gpGlobals = ismm->GetCGlobals(); + return true; +} diff --git a/extension.h b/extension.h index 96d3a07..f28c78b 100644 --- a/extension.h +++ b/extension.h @@ -91,7 +91,7 @@ public: * @param late Whether or not Metamod considers this a late load. * @return True to succeed, false to fail. */ - //virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlength, bool late); + virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlength, bool late); /** * @brief Called when Metamod is detaching, after the extension version is called. @@ -116,4 +116,6 @@ public: #endif }; + + #endif // _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_