Add support for nested datatables. (bug 5446, r=asherkin)

This commit is contained in:
Kyle Sanderson
2013-08-12 00:54:21 +01:00
parent 6af85409f1
commit b9cd424186
8 changed files with 269 additions and 165 deletions
+18 -1
View File
@@ -40,7 +40,7 @@
*/
#define SMINTERFACE_GAMEHELPERS_NAME "IGameHelpers"
#define SMINTERFACE_GAMEHELPERS_VERSION 9
#define SMINTERFACE_GAMEHELPERS_VERSION 10
class CBaseEntity;
class CBaseHandle;
@@ -66,6 +66,12 @@ namespace SourceMod
SendProp *prop; /**< Property instance. */
unsigned int actual_offset; /**< Actual computed offset. */
};
struct sm_datatable_info_t
{
typedescription_t *prop; /**< Property instance. */
unsigned int actual_offset; /**< Actual computed offset. */
};
class IGameHelpers : public SMInterface
{
@@ -318,6 +324,17 @@ namespace SourceMod
* @return True if valid, otherwise false.
*/
virtual bool IsMapValid(const char *map) =0;
/**
* @brief Finds a datamap_t definition.
*
* @param pMap datamap_t pointer.
* @param offset Property name.
* @param pDataTable Buffer to store sm_datatable_info_t data.
* @return typedescription_t pointer on success, NULL
* on failure.
*/
virtual bool FindDataMapInfo(datamap_t *pMap, const char *offset, sm_datatable_info_t *pDataTable) =0;
};
}