[quake3-commits] r2353 - in trunk/code: botlib client game qcommon

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Nov 18 14:09:55 EST 2012


Author: ztm
Date: 2012-11-18 14:09:54 -0500 (Sun, 18 Nov 2012)
New Revision: 2353

Modified:
   trunk/code/botlib/be_ai_move.c
   trunk/code/client/snd_dma.c
   trunk/code/client/snd_openal.c
   trunk/code/game/ai_dmq3.c
   trunk/code/qcommon/files.c
Log:
Fix some "> MAX_*" to be ">= MAX_*".

Modified: trunk/code/botlib/be_ai_move.c
===================================================================
--- trunk/code/botlib/be_ai_move.c	2012-11-14 10:56:31 UTC (rev 2352)
+++ trunk/code/botlib/be_ai_move.c	2012-11-18 19:09:54 UTC (rev 2353)
@@ -522,7 +522,7 @@
 		if (model[0]) modelnum = atoi(model+1);
 		else modelnum = 0;
 
-		if (modelnum < 0 || modelnum > MAX_MODELS)
+		if (modelnum < 0 || modelnum >= MAX_MODELS)
 		{
 			botimport.Print(PRT_MESSAGE, "entity %s model number out of range\n", classname);
 			continue;

Modified: trunk/code/client/snd_dma.c
===================================================================
--- trunk/code/client/snd_dma.c	2012-11-14 10:56:31 UTC (rev 2352)
+++ trunk/code/client/snd_dma.c	2012-11-18 19:09:54 UTC (rev 2353)
@@ -529,7 +529,7 @@
 		return;
 	}
 
-	if ( !origin && ( entityNum < 0 || entityNum > MAX_GENTITIES ) ) {
+	if ( !origin && ( entityNum < 0 || entityNum >= MAX_GENTITIES ) ) {
 		Com_Error( ERR_DROP, "S_StartSound: bad entitynum %i", entityNum );
 	}
 
@@ -1092,7 +1092,7 @@
 ======================
 */
 void S_Base_UpdateEntityPosition( int entityNum, const vec3_t origin ) {
-	if ( entityNum < 0 || entityNum > MAX_GENTITIES ) {
+	if ( entityNum < 0 || entityNum >= MAX_GENTITIES ) {
 		Com_Error( ERR_DROP, "S_UpdateEntityPosition: bad entitynum %i", entityNum );
 	}
 	VectorCopy( origin, loopSounds[entityNum].origin );

Modified: trunk/code/client/snd_openal.c
===================================================================
--- trunk/code/client/snd_openal.c	2012-11-14 10:56:31 UTC (rev 2352)
+++ trunk/code/client/snd_openal.c	2012-11-18 19:09:54 UTC (rev 2353)
@@ -1121,7 +1121,7 @@
 
 	VectorCopy( origin, sanOrigin );
 	S_AL_SanitiseVector( sanOrigin );
-	if ( entityNum < 0 || entityNum > MAX_GENTITIES )
+	if ( entityNum < 0 || entityNum >= MAX_GENTITIES )
 		Com_Error( ERR_DROP, "S_UpdateEntityPosition: bad entitynum %i", entityNum );
 	VectorCopy( sanOrigin, entityList[entityNum].origin );
 }
@@ -1135,7 +1135,7 @@
 */
 static qboolean S_AL_CheckInput(int entityNum, sfxHandle_t sfx)
 {
-	if (entityNum < 0 || entityNum > MAX_GENTITIES)
+	if (entityNum < 0 || entityNum >= MAX_GENTITIES)
 		Com_Error(ERR_DROP, "ERROR: S_AL_CheckInput: bad entitynum %i", entityNum);
 
 	if (sfx < 0 || sfx >= numSfx)

Modified: trunk/code/game/ai_dmq3.c
===================================================================
--- trunk/code/game/ai_dmq3.c	2012-11-14 10:56:31 UTC (rev 2352)
+++ trunk/code/game/ai_dmq3.c	2012-11-18 19:09:54 UTC (rev 2353)
@@ -4838,7 +4838,7 @@
 		}
 		case EV_GLOBAL_SOUND:
 		{
-			if (state->eventParm < 0 || state->eventParm > MAX_SOUNDS) {
+			if (state->eventParm < 0 || state->eventParm >= MAX_SOUNDS) {
 				BotAI_Print(PRT_ERROR, "EV_GLOBAL_SOUND: eventParm (%d) out of range\n", state->eventParm);
 				break;
 			}
@@ -4948,7 +4948,7 @@
 		{
 			//if this sound is played on the bot
 			if (state->number == bs->client) {
-				if (state->eventParm < 0 || state->eventParm > MAX_SOUNDS) {
+				if (state->eventParm < 0 || state->eventParm >= MAX_SOUNDS) {
 					BotAI_Print(PRT_ERROR, "EV_GENERAL_SOUND: eventParm (%d) out of range\n", state->eventParm);
 					break;
 				}

Modified: trunk/code/qcommon/files.c
===================================================================
--- trunk/code/qcommon/files.c	2012-11-14 10:56:31 UTC (rev 2352)
+++ trunk/code/qcommon/files.c	2012-11-18 19:09:54 UTC (rev 2353)
@@ -395,7 +395,7 @@
 }
 
 static FILE	*FS_FileForHandle( fileHandle_t f ) {
-	if ( f < 1 || f > MAX_FILE_HANDLES ) {
+	if ( f < 1 || f >= MAX_FILE_HANDLES ) {
 		Com_Error( ERR_DROP, "FS_FileForHandle: out of range" );
 	}
 	if (fsh[f].zipFile == qtrue) {



More information about the quake3-commits mailing list