added state change function
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40564
This commit is contained in:
@@ -437,8 +437,40 @@ static cell_t SetEntDataEnt(IPluginContext *pContext, const cell_t *params)
|
||||
return 1;
|
||||
}
|
||||
|
||||
IChangeInfoAccessor *CBaseEdict::GetChangeAccessor()
|
||||
{
|
||||
return engine->GetChangeAccessor( (const edict_t *)this );
|
||||
}
|
||||
|
||||
CSharedEdictChangeInfo *g_pSharedChangeInfo = NULL;
|
||||
|
||||
static cell_t ChangeEdictState(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
edict_t *pEdict = GetEdict(params[1]);
|
||||
|
||||
if (!pEdict)
|
||||
{
|
||||
return pContext->ThrowNativeError("Edict %d is invalid", params[1]);
|
||||
}
|
||||
|
||||
if (!g_pSharedChangeInfo)
|
||||
{
|
||||
g_pSharedChangeInfo = engine->GetSharedEdictChangeInfo();
|
||||
}
|
||||
|
||||
if (params[2])
|
||||
{
|
||||
pEdict->StateChanged(params[2]);
|
||||
} else {
|
||||
pEdict->StateChanged();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
REGISTER_NATIVES(entityNatives)
|
||||
{
|
||||
{"ChangeEdictState", ChangeEdictState},
|
||||
{"CreateEdict", CreateEdict},
|
||||
{"GetEdictClassname", GetEdictClassname},
|
||||
{"GetEdictFlags", GetEdictFlags},
|
||||
|
||||
Reference in New Issue
Block a user