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},
};

View File

@ -2026,7 +2026,7 @@ typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/);
typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/);
typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char */*name */);
typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */);
extern PFN_ADD_NATIVES g_fn_AddNatives;
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;