From 89eda75b1f32e91af25eb254ce06bb760588145e Mon Sep 17 00:00:00 2001 From: Steve Dudenhoeffer Date: Wed, 20 Oct 2004 14:24:54 +0000 Subject: [PATCH] Touch it and die, bail. --- dlls/fakemeta/fakemeta_amxx.h | 3 +++ dlls/fakemeta/pev.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/dlls/fakemeta/fakemeta_amxx.h b/dlls/fakemeta/fakemeta_amxx.h index c47a0260..7a245038 100755 --- a/dlls/fakemeta/fakemeta_amxx.h +++ b/dlls/fakemeta/fakemeta_amxx.h @@ -19,6 +19,7 @@ inline edict_t* INDEXENT2( int iEdictNum ) else return (*g_engfuncs.pfnPEntityOfEntIndex)(iEdictNum); } +#ifdef DONT_TOUCH_THIS_AGAIN_BAIL #define CHECK_ENTITY(x) \ if (x < 0 || x > gpGlobals->maxEntities) { \ MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \ @@ -36,7 +37,9 @@ inline edict_t* INDEXENT2( int iEdictNum ) } \ } \ } +#endif +#define CHECK_ENTITY(x) if (x != 0 && (FNullEnt(INDEXENT2(x)) || x < 0 || x > gpGlobals->maxEntities)) { MF_RaiseAmxError(amx,AMX_ERR_NATIVE); return 0; } extern AMX_NATIVE_INFO engfunc_natives[]; extern AMX_NATIVE_INFO dllfunc_natives[]; extern AMX_NATIVE_INFO pev_natives[]; diff --git a/dlls/fakemeta/pev.cpp b/dlls/fakemeta/pev.cpp index 6f2cca51..77f103fb 100755 --- a/dlls/fakemeta/pev.cpp +++ b/dlls/fakemeta/pev.cpp @@ -4,6 +4,7 @@ static cell AMX_NATIVE_CALL amx_pev(AMX *amx,cell *params) { int index=params[1]; +#ifdef DONT_TOUCH_THIS_AGAIN_BAIL if (index >= 1 && index <= gpGlobals->maxClients) { if (!MF_IsPlayerIngame(index)) @@ -18,6 +19,8 @@ static cell AMX_NATIVE_CALL amx_pev(AMX *amx,cell *params) return 0; } } +#endif + CHECK_ENTITY(index); edict_t *pPlayer = INDEXENT2(index); int returntype = *params/sizeof(cell); int valuetype=0;