Add GetGameRules to ISDKTools (bug 4707, r=pred)

This commit is contained in:
Brett Powell 2010-11-19 17:37:26 +13:00
parent ac738aff10
commit 616113d384
2 changed files with 14 additions and 1 deletions

View File

@ -441,6 +441,11 @@ public:
{ {
return iserver; return iserver;
} }
virtual IGameRules *GetGameRules()
{
return (IGameRules*)g_pGameRules;
}
} g_SDKTools_API; } g_SDKTools_API;
static void InitSDKToolsAPI() static void InitSDKToolsAPI()

View File

@ -35,9 +35,10 @@
#include <IShareSys.h> #include <IShareSys.h>
#define SMINTERFACE_SDKTOOLS_NAME "ISDKTools" #define SMINTERFACE_SDKTOOLS_NAME "ISDKTools"
#define SMINTERFACE_SDKTOOLS_VERSION 1 #define SMINTERFACE_SDKTOOLS_VERSION 2
class IServer; class IServer;
class IGameRules;
/** /**
* @brief SDKTools shared API * @brief SDKTools shared API
@ -61,6 +62,13 @@ namespace SourceMod
* @return IServer pointer, or NULL if SDKTools was unable to find one. * @return IServer pointer, or NULL if SDKTools was unable to find one.
*/ */
virtual IServer* GetIServer() = 0; 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;
}; };
} }