mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-24 13:55:36 +03:00
Quick patch for possible bug at15468
This commit is contained in:
parent
0d90a958ae
commit
559d8bc7eb
@ -403,11 +403,6 @@ static cell AMX_NATIVE_CALL attach_view(AMX *amx, cell *params)
|
|||||||
int iIndex = params[1];
|
int iIndex = params[1];
|
||||||
int iTargetIndex = params[2];
|
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);
|
CHECK_ENTITY(iIndex);
|
||||||
|
|
||||||
SET_VIEW(INDEXENT2(iIndex), INDEXENT2(iTargetIndex));
|
SET_VIEW(INDEXENT2(iIndex), INDEXENT2(iTargetIndex));
|
||||||
|
@ -162,7 +162,7 @@ extern edict_t *g_player_edicts[33];
|
|||||||
inline edict_t* INDEXENT2( int iEdictNum )
|
inline edict_t* INDEXENT2( int iEdictNum )
|
||||||
{
|
{
|
||||||
if (iEdictNum >= 1 && iEdictNum <= gpGlobals->maxClients)
|
if (iEdictNum >= 1 && iEdictNum <= gpGlobals->maxClients)
|
||||||
return g_player_edicts[iEdictNum];
|
return MF_GetPlayerEdict(iEdictNum);
|
||||||
|
|
||||||
else
|
else
|
||||||
return (*g_engfuncs.pfnPEntityOfEntIndex)(iEdictNum);
|
return (*g_engfuncs.pfnPEntityOfEntIndex)(iEdictNum);
|
||||||
|
Loading…
Reference in New Issue
Block a user