Added GetEntityAddress native (bug 5269, r=dvander).

This commit is contained in:
Michael Busby
2012-07-22 13:40:37 -04:00
parent 99ff1179cc
commit a46dcd45d7
2 changed files with 20 additions and 0 deletions
+11
View File
@@ -2226,6 +2226,16 @@ static cell_t SetEntityFlags(IPluginContext *pContext, const cell_t *params)
return 0;
}
static cell_t GetEntityAddress(IPluginContext *pContext, const cell_t *params)
{
CBaseEntity * pEntity = GetEntity(params[1]);
if (!pEntity)
{
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
}
return reinterpret_cast<cell_t>(pEntity);
}
REGISTER_NATIVES(entityNatives)
{
{"ChangeEdictState", ChangeEdictState},
@@ -2268,5 +2278,6 @@ REGISTER_NATIVES(entityNatives)
{"SetEntPropFloat", SetEntPropFloat},
{"SetEntPropString", SetEntPropString},
{"SetEntPropVector", SetEntPropVector},
{"GetEntityAddress", GetEntityAddress},
{NULL, NULL}
};