made worldspawn a valid ent

This commit is contained in:
David Anderson 2004-10-03 23:21:54 +00:00
parent 0a3911231b
commit bb12f71137
6 changed files with 12 additions and 12 deletions

View File

@ -215,7 +215,7 @@ bool g_noknives = false;
// Globals above // Globals above
#define CHECK_ENTITY(x) \ #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); \ MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \
} else { \ } else { \
if (x <= gpGlobals->maxClients) { \ 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); \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \
} \ } \
} else { \ } else { \
if (FNullEnt(INDEXENT(x))) { \ if (x != 0 && FNullEnt(INDEXENT(x))) { \
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \
} \ } \
} \ } \

View File

@ -59,7 +59,7 @@ extern CPlayer* mPlayer;
edict_t *FindEntityByClassname(edict_t *pentStart, const char *szName); edict_t *FindEntityByClassname(edict_t *pentStart, const char *szName);
#define CHECK_ENTITY(x) \ #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); \ MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \
} else { \ } else { \
if (x <= gpGlobals->maxClients) { \ 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); \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \
} \ } \
} else { \ } else { \
if (FNullEnt(INDEXENT(x))) { \ if (x != 0 && FNullEnt(INDEXENT(x))) { \
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \
} \ } \
} \ } \

View File

@ -112,7 +112,7 @@ bool isModuleActive();
edict_t *FindEntityByClassname(edict_t *pentStart, const char *szName); edict_t *FindEntityByClassname(edict_t *pentStart, const char *szName);
#define CHECK_ENTITY(x) \ #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); \ MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \
} else { \ } else { \
if (x <= gpGlobals->maxClients) { \ 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); \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \
} \ } \
} else { \ } else { \
if (FNullEnt(INDEXENT(x))) { \ if (x != 0 && FNullEnt(INDEXENT(x))) { \
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \
} \ } \
} \ } \

View File

@ -181,7 +181,7 @@ void pfnTouch(edict_t *pToucher, edict_t *pTouched);
void Think(edict_t *pent); void Think(edict_t *pent);
#define CHECK_ENTITY(x) \ #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); \ MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \
} else { \ } else { \
if (x <= gpGlobals->maxClients) { \ 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); \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \
} \ } \
} else { \ } else { \
if (FNullEnt(INDEXENT2(x))) { \ if (x != 0 && FNullEnt(INDEXENT(x))) { \
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \
} \ } \
} \ } \

View File

@ -106,7 +106,7 @@ bool isModuleActive();
bool util_strncmp( const char *sz1, const char *sz2, int size); bool util_strncmp( const char *sz1, const char *sz2, int size);
#define CHECK_ENTITY(x) \ #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); \ MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \
} else { \ } else { \
if (x <= gpGlobals->maxClients) { \ 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); \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \
} \ } \
} else { \ } else { \
if (FNullEnt(INDEXENT(x))) { \ if (x != 0 && FNullEnt(INDEXENT(x))) { \
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \
} \ } \
} \ } \

View File

@ -109,7 +109,7 @@ bool isModuleActive();
bool ignoreBots (edict_t *pEnt, edict_t *pOther = NULL); bool ignoreBots (edict_t *pEnt, edict_t *pOther = NULL);
#define CHECK_ENTITY(x) \ #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); \ MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \
} else { \ } else { \
if (x <= gpGlobals->maxClients) { \ 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); \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \
} \ } \
} else { \ } else { \
if (FNullEnt(INDEXENT(x))) { \ if (x != 0 && FNullEnt(INDEXENT(x))) { \
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \ MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \
} \ } \
} \ } \