added pev_valid()

This commit is contained in:
David Anderson 2006-02-01 12:16:33 +00:00
parent 4426910b9a
commit 53d9274b45
2 changed files with 17 additions and 2 deletions

View File

@ -613,7 +613,6 @@ static cell AMX_NATIVE_CALL amx_set_pev(AMX *amx, cell *params)
if (iSwitch > pev_int_start && iSwitch < pev_int_end)
{
// Grrr...
int len;
int iValue = blah[0];
switch(iSwitch)
{
@ -1070,8 +1069,24 @@ static cell AMX_NATIVE_CALL amx_set_pev(AMX *amx, cell *params)
return 0;
}
static cell AMX_NATIVE_CALL amx_pev_valid(AMX *amx, cell *params)
{
int idx = static_cast<int>(params[1]);
edict_t *e = INDEXENT(idx);
if (FNullEnt(e))
return 0;
if (e->pvPrivateData)
return 2;
return 1;
}
AMX_NATIVE_INFO pev_natives[] = {
{ "pev", amx_pev },
{ "set_pev", amx_set_pev },
{ "pev_valid", amx_pev_valid },
{NULL, NULL},
};