From 559d8bc7eb35f8c209cb7f16222614518ecc40f7 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 29 Jul 2005 20:23:08 +0000 Subject: [PATCH] Quick patch for possible bug at15468 --- dlls/engine/engine.cpp | 5 ----- dlls/engine/engine.h | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/dlls/engine/engine.cpp b/dlls/engine/engine.cpp index 3ba2c1a4..ffe59d07 100755 --- a/dlls/engine/engine.cpp +++ b/dlls/engine/engine.cpp @@ -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)); diff --git a/dlls/engine/engine.h b/dlls/engine/engine.h index 36717d10..6c27d927 100755 --- a/dlls/engine/engine.h +++ b/dlls/engine/engine.h @@ -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);