Fixed bad error checking routine

This commit is contained in:
David Anderson
2004-10-04 20:32:26 +00:00
parent 766246648d
commit 77aa0f4f8e
8 changed files with 36 additions and 8 deletions

View File

@ -125,6 +125,13 @@ bool isModuleActive();
} \
}
#define CHECK_PLAYERRANGE(x) \
if (x > gpGlobals->maxClients || x < 0) \
{ \
MF_LogError(amx, AMX_ERR_NATIVE, "Player out of range (%d)", x); \
return 0; \
}
#define CHECK_NONPLAYER(x) \
if (x < 1 || x <= gpGlobals->maxClients || x > gpGlobals->maxEntities) { \
MF_LogError(amx, AMX_ERR_NATIVE, "Non-player entity %d out of range", x); \