fixed bug am44694 (is_user_alive() on TFC connect failing)

This commit is contained in:
David Anderson
2006-09-21 23:33:05 +00:00
parent 98e20e0fc7
commit 3720810b61
2 changed files with 15 additions and 0 deletions

View File

@ -542,14 +542,27 @@ static cell AMX_NATIVE_CALL is_user_hltv(AMX *amx, cell *params) /* 1 param */
return 0;
}
extern bool g_bmod_tfc;
static cell AMX_NATIVE_CALL is_user_alive(AMX *amx, cell *params) /* 1 param */
{
int index = params[1];
if (index < 1 || index > gpGlobals->maxClients)
{
return 0;
}
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
if (g_bmod_tfc)
{
edict_t *e = pPlayer->pEdict;
if (e->v.flags & FL_SPECTATOR ||
(!e->v.team || !e->v.playerclass))
{
return 0;
}
}
return ((pPlayer->ingame && pPlayer->IsAlive()) ? 1 : 0);
}