diff --git a/extensions/sdktools/extension.cpp b/extensions/sdktools/extension.cpp index ba175808..269f5e2c 100644 --- a/extensions/sdktools/extension.cpp +++ b/extensions/sdktools/extension.cpp @@ -441,6 +441,11 @@ public: { return iserver; } + + virtual IGameRules *GetGameRules() + { + return (IGameRules*)g_pGameRules; + } } g_SDKTools_API; static void InitSDKToolsAPI() diff --git a/public/extensions/ISDKTools.h b/public/extensions/ISDKTools.h index 289f41d1..f353e800 100644 --- a/public/extensions/ISDKTools.h +++ b/public/extensions/ISDKTools.h @@ -35,9 +35,10 @@ #include #define SMINTERFACE_SDKTOOLS_NAME "ISDKTools" -#define SMINTERFACE_SDKTOOLS_VERSION 1 +#define SMINTERFACE_SDKTOOLS_VERSION 2 class IServer; +class IGameRules; /** * @brief SDKTools shared API @@ -61,6 +62,13 @@ namespace SourceMod * @return IServer pointer, or NULL if SDKTools was unable to find one. */ virtual IServer* GetIServer() = 0; + + /** + * @brief Returns a pointer to GameRules if one was found. + * + * @return GameRules pointer, or NULL if SDKTools was unable to find one. + */ + virtual IGameRules* GetGameRules() = 0; }; }