# HG changeset patch # User Nicholas Hastings # Date 1290225747 18000 # Node ID a998690a87e43d893213a0fadd81423b4b78ddd3 # Parent 2469806bb7ed37f79775b12d8e52ac5deb6d3094 Add GetGameRules to ISDKTools (bug 4707, r=fyren) diff -r 2469806bb7ed -r a998690a87e4 extensions/sdktools/extension.cpp --- a/extensions/sdktools/extension.cpp Fri Nov 19 15:52:41 2010 -0500 +++ b/extensions/sdktools/extension.cpp Fri Nov 19 23:02:27 2010 -0500 @@ -441,6 +441,14 @@ { return iserver; } + + virtual void *GetGameRules() + { + if (!g_pGameRules) + return NULL; + + return *g_pGameRules; + } } g_SDKTools_API; static void InitSDKToolsAPI() diff -r 2469806bb7ed -r a998690a87e4 public/extensions/ISDKTools.h --- a/public/extensions/ISDKTools.h Fri Nov 19 15:52:41 2010 -0500 +++ b/public/extensions/ISDKTools.h Fri Nov 19 23:02:27 2010 -0500 @@ -35,7 +35,7 @@ #include #define SMINTERFACE_SDKTOOLS_NAME "ISDKTools" -#define SMINTERFACE_SDKTOOLS_VERSION 1 +#define SMINTERFACE_SDKTOOLS_VERSION 2 class IServer; @@ -61,6 +61,13 @@ * @return IServer pointer, or NULL if SDKTools was unable to find one. */ virtual IServer* GetIServer() = 0; + + /** + * @brief Returns a pointer to game's CGameRules class. + * + * @return CGameRules pointer or NULL if not found. + */ + virtual void* GetGameRules() = 0; }; }