From 616113d384c2bf81e52430e458517a8fe0f140c2 Mon Sep 17 00:00:00 2001 From: Brett Powell Date: Fri, 19 Nov 2010 17:37:26 +1300 Subject: [PATCH] Add GetGameRules to ISDKTools (bug 4707, r=pred) --- extensions/sdktools/extension.cpp | 5 +++++ public/extensions/ISDKTools.h | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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; }; }