From bb12f71137d1fb7cbaad47ead3f949833fdb02e7 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 3 Oct 2004 23:21:54 +0000 Subject: [PATCH] made worldspawn a valid ent --- dlls/cstrike/cstrike.h | 4 ++-- dlls/dod2/dodfun/dodfun.h | 4 ++-- dlls/dod2/dodx/dodx.h | 4 ++-- dlls/engine/engine.h | 4 ++-- dlls/tfc/tfcx/tfcx.h | 4 ++-- dlls/ts/tsx/tsx.h | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dlls/cstrike/cstrike.h b/dlls/cstrike/cstrike.h index 3a6d0c52..44883b94 100755 --- a/dlls/cstrike/cstrike.h +++ b/dlls/cstrike/cstrike.h @@ -215,7 +215,7 @@ bool g_noknives = false; // Globals above #define CHECK_ENTITY(x) \ - if (x <= 0 || x > gpGlobals->maxEntities) { \ + if (x < 0 || x > gpGlobals->maxEntities) { \ MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \ } else { \ if (x <= gpGlobals->maxClients) { \ @@ -223,7 +223,7 @@ bool g_noknives = false; MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \ } \ } else { \ - if (FNullEnt(INDEXENT(x))) { \ + if (x != 0 && FNullEnt(INDEXENT(x))) { \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \ } \ } \ diff --git a/dlls/dod2/dodfun/dodfun.h b/dlls/dod2/dodfun/dodfun.h index d7138512..1d6362fd 100755 --- a/dlls/dod2/dodfun/dodfun.h +++ b/dlls/dod2/dodfun/dodfun.h @@ -59,7 +59,7 @@ extern CPlayer* mPlayer; edict_t *FindEntityByClassname(edict_t *pentStart, const char *szName); #define CHECK_ENTITY(x) \ - if (x <= 0 || x > gpGlobals->maxEntities) { \ + if (x < 0 || x > gpGlobals->maxEntities) { \ MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \ } else { \ if (x <= gpGlobals->maxClients) { \ @@ -67,7 +67,7 @@ edict_t *FindEntityByClassname(edict_t *pentStart, const char *szName); MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \ } \ } else { \ - if (FNullEnt(INDEXENT(x))) { \ + if (x != 0 && FNullEnt(INDEXENT(x))) { \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \ } \ } \ diff --git a/dlls/dod2/dodx/dodx.h b/dlls/dod2/dodx/dodx.h index 0ca02309..622ce121 100755 --- a/dlls/dod2/dodx/dodx.h +++ b/dlls/dod2/dodx/dodx.h @@ -112,7 +112,7 @@ bool isModuleActive(); edict_t *FindEntityByClassname(edict_t *pentStart, const char *szName); #define CHECK_ENTITY(x) \ - if (x <= 0 || x > gpGlobals->maxEntities) { \ + if (x < 0 || x > gpGlobals->maxEntities) { \ MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \ } else { \ if (x <= gpGlobals->maxClients) { \ @@ -120,7 +120,7 @@ edict_t *FindEntityByClassname(edict_t *pentStart, const char *szName); MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \ } \ } else { \ - if (FNullEnt(INDEXENT(x))) { \ + if (x != 0 && FNullEnt(INDEXENT(x))) { \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \ } \ } \ diff --git a/dlls/engine/engine.h b/dlls/engine/engine.h index 613a42b9..0682391e 100755 --- a/dlls/engine/engine.h +++ b/dlls/engine/engine.h @@ -181,7 +181,7 @@ void pfnTouch(edict_t *pToucher, edict_t *pTouched); void Think(edict_t *pent); #define CHECK_ENTITY(x) \ - if (x <= 0 || x > gpGlobals->maxEntities) { \ + if (x < 0 || x > gpGlobals->maxEntities) { \ MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \ } else { \ if (x <= gpGlobals->maxClients) { \ @@ -189,7 +189,7 @@ void Think(edict_t *pent); MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \ } \ } else { \ - if (FNullEnt(INDEXENT2(x))) { \ + if (x != 0 && FNullEnt(INDEXENT(x))) { \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \ } \ } \ diff --git a/dlls/tfc/tfcx/tfcx.h b/dlls/tfc/tfcx/tfcx.h index bf38f26c..0649cc98 100755 --- a/dlls/tfc/tfcx/tfcx.h +++ b/dlls/tfc/tfcx/tfcx.h @@ -106,7 +106,7 @@ bool isModuleActive(); bool util_strncmp( const char *sz1, const char *sz2, int size); #define CHECK_ENTITY(x) \ - if (x <= 0 || x > gpGlobals->maxEntities) { \ + if (x < 0 || x > gpGlobals->maxEntities) { \ MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \ } else { \ if (x <= gpGlobals->maxClients) { \ @@ -114,7 +114,7 @@ bool util_strncmp( const char *sz1, const char *sz2, int size); MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \ } \ } else { \ - if (FNullEnt(INDEXENT(x))) { \ + if (x != 0 && FNullEnt(INDEXENT(x))) { \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \ } \ } \ diff --git a/dlls/ts/tsx/tsx.h b/dlls/ts/tsx/tsx.h index fdb07ffb..18720801 100755 --- a/dlls/ts/tsx/tsx.h +++ b/dlls/ts/tsx/tsx.h @@ -109,7 +109,7 @@ bool isModuleActive(); bool ignoreBots (edict_t *pEnt, edict_t *pOther = NULL); #define CHECK_ENTITY(x) \ - if (x <= 0 || x > gpGlobals->maxEntities) { \ + if (x < 0 || x > gpGlobals->maxEntities) { \ MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \ } else { \ if (x <= gpGlobals->maxClients) { \ @@ -117,7 +117,7 @@ bool ignoreBots (edict_t *pEnt, edict_t *pOther = NULL); MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \ } \ } else { \ - if (FNullEnt(INDEXENT(x))) { \ + if (x != 0 && FNullEnt(INDEXENT(x))) { \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \ } \ } \