Quick patch for possible bug at15468

This commit is contained in:
David Anderson 2005-07-29 20:23:08 +00:00
parent 0d90a958ae
commit 559d8bc7eb
2 changed files with 1 additions and 6 deletions

View File

@ -403,11 +403,6 @@ static cell AMX_NATIVE_CALL attach_view(AMX *amx, cell *params)
int iIndex = params[1];
int iTargetIndex = params[2];
if (iIndex > gpGlobals->maxClients || !MF_IsPlayerIngame(iIndex)) {
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d", iIndex);
return 0;
}
CHECK_ENTITY(iIndex);
SET_VIEW(INDEXENT2(iIndex), INDEXENT2(iTargetIndex));

View File

@ -162,7 +162,7 @@ extern edict_t *g_player_edicts[33];
inline edict_t* INDEXENT2( int iEdictNum )
{
if (iEdictNum >= 1 && iEdictNum <= gpGlobals->maxClients)
return g_player_edicts[iEdictNum];
return MF_GetPlayerEdict(iEdictNum);
else
return (*g_engfuncs.pfnPEntityOfEntIndex)(iEdictNum);