[quake3-commits] r1790 - in trunk/code: game q3_ui qcommon renderer ui

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Aug 29 13:32:54 EDT 2010


Author: thilo
Date: 2010-08-29 13:32:54 -0400 (Sun, 29 Aug 2010)
New Revision: 1790

Modified:
   trunk/code/game/ai_dmq3.c
   trunk/code/q3_ui/ui_servers2.c
   trunk/code/q3_ui/ui_startserver.c
   trunk/code/qcommon/q_shared.h
   trunk/code/renderer/tr_shade_calc.c
   trunk/code/ui/ui_main.c
Log:
First batch of bug fixes reported and patched by Zack "ZTurtleMan" Middleton:
#4736
#4730
#4731
#4732
#4733
#4735
#4736
#4737
#4738
#4739


Modified: trunk/code/game/ai_dmq3.c
===================================================================
--- trunk/code/game/ai_dmq3.c	2010-08-29 16:49:42 UTC (rev 1789)
+++ trunk/code/game/ai_dmq3.c	2010-08-29 17:32:54 UTC (rev 1790)
@@ -2510,7 +2510,7 @@
 	//if the bot isn't healthy anough
 	if (BotAggression(bs) < 50) return qfalse;
 	//the bot should have at least have the rocket launcher, the railgun or the bfg10k with some ammo
-	if ((bs->inventory[INVENTORY_ROCKETLAUNCHER] <= 0 || bs->inventory[INVENTORY_ROCKETS < 10]) &&
+	if ((bs->inventory[INVENTORY_ROCKETLAUNCHER] <= 0 || bs->inventory[INVENTORY_ROCKETS] < 10) &&
 		(bs->inventory[INVENTORY_RAILGUN] <= 0 || bs->inventory[INVENTORY_SLUGS] < 10) &&
 		(bs->inventory[INVENTORY_BFG10K] <= 0 || bs->inventory[INVENTORY_BFGAMMO] < 10)) {
 		return qfalse;

Modified: trunk/code/q3_ui/ui_servers2.c
===================================================================
--- trunk/code/q3_ui/ui_servers2.c	2010-08-29 16:49:42 UTC (rev 1789)
+++ trunk/code/q3_ui/ui_servers2.c	2010-08-29 17:32:54 UTC (rev 1790)
@@ -147,8 +147,8 @@
 };
 
 static char* netnames[] = {
-	"???",
-	"UDP",
+	"??? ",
+	"UDP ",
 	"UDP6",
 	NULL
 };
@@ -534,7 +534,7 @@
 			pingColor = S_COLOR_RED;
 		}
 
-		Com_sprintf( buff, MAX_LISTBOXWIDTH, "%-20.20s %-12.12s %2d/%2d %-8.8s %3s %s%3d " S_COLOR_YELLOW "%s", 
+		Com_sprintf( buff, MAX_LISTBOXWIDTH, "%-20.20s %-12.12s %2d/%2d %-8.8s %4s%s%3d " S_COLOR_YELLOW "%s", 
 			servernodeptr->hostname, servernodeptr->mapname, servernodeptr->numclients,
  			servernodeptr->maxclients, servernodeptr->gamename,
 			netnames[servernodeptr->nettype], pingColor, servernodeptr->pingtime, servernodeptr->bPB ? "Yes" : "No" );
@@ -672,6 +672,9 @@
 	}
 	*/
 	servernodeptr->nettype = atoi(Info_ValueForKey(info, "nettype"));
+	if (servernodeptr->nettype < 0 || servernodeptr->nettype >= ARRAY_LEN(netnames)) {
+		servernodeptr->nettype = 0;
+	}
 
 	s = Info_ValueForKey( info, "game");
 	i = atoi( Info_ValueForKey( info, "gametype") );

Modified: trunk/code/q3_ui/ui_startserver.c
===================================================================
--- trunk/code/q3_ui/ui_startserver.c	2010-08-29 16:49:42 UTC (rev 1789)
+++ trunk/code/q3_ui/ui_startserver.c	2010-08-29 17:32:54 UTC (rev 1790)
@@ -766,13 +766,13 @@
 	case GT_TEAM:
 		trap_Cvar_SetValue( "ui_team_fraglimit", fraglimit );
 		trap_Cvar_SetValue( "ui_team_timelimit", timelimit );
-		trap_Cvar_SetValue( "ui_team_friendlt", friendlyfire );
+		trap_Cvar_SetValue( "ui_team_friendly", friendlyfire );
 		break;
 
 	case GT_CTF:
-		trap_Cvar_SetValue( "ui_ctf_fraglimit", fraglimit );
+		trap_Cvar_SetValue( "ui_ctf_capturelimit", flaglimit );
 		trap_Cvar_SetValue( "ui_ctf_timelimit", timelimit );
-		trap_Cvar_SetValue( "ui_ctf_friendlt", friendlyfire );
+		trap_Cvar_SetValue( "ui_ctf_friendly", friendlyfire );
 		break;
 	}
 
@@ -1239,7 +1239,7 @@
 
 	memset( &s_serveroptions, 0 ,sizeof(serveroptions_t) );
 	s_serveroptions.multiplayer = multiplayer;
-	s_serveroptions.gametype = (int)Com_Clamp( 0, 5, trap_Cvar_VariableValue( "g_gameType" ) );
+	s_serveroptions.gametype = (int)Com_Clamp( 0, GT_MAX_GAME_TYPE - 1, trap_Cvar_VariableValue( "g_gameType" ) );
 	s_serveroptions.punkbuster.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "sv_punkbuster" ) );
 
 	ServerOptions_Cache();

Modified: trunk/code/qcommon/q_shared.h
===================================================================
--- trunk/code/qcommon/q_shared.h	2010-08-29 16:49:42 UTC (rev 1789)
+++ trunk/code/qcommon/q_shared.h	2010-08-29 17:32:54 UTC (rev 1790)
@@ -191,7 +191,9 @@
 #define	MAX_QINT			0x7fffffff
 #define	MIN_QINT			(-MAX_QINT-1)
 
+#define ARRAY_LEN(x)			(sizeof(x) / sizeof(*x))
 
+
 // angle indexes
 #define	PITCH				0		// up / down
 #define	YAW					1		// left / right

Modified: trunk/code/renderer/tr_shade_calc.c
===================================================================
--- trunk/code/renderer/tr_shade_calc.c	2010-08-29 16:49:42 UTC (rev 1789)
+++ trunk/code/renderer/tr_shade_calc.c	2010-08-29 17:32:54 UTC (rev 1790)
@@ -359,10 +359,10 @@
 	vec3_t	leftDir, upDir;
 
 	if ( tess.numVertexes & 3 ) {
-		ri.Printf( PRINT_WARNING, "Autosprite shader %s had odd vertex count", tess.shader->name );
+		ri.Printf( PRINT_WARNING, "Autosprite shader %s had odd vertex count\n", tess.shader->name );
 	}
 	if ( tess.numIndexes != ( tess.numVertexes >> 2 ) * 6 ) {
-		ri.Printf( PRINT_WARNING, "Autosprite shader %s had odd index count", tess.shader->name );
+		ri.Printf( PRINT_WARNING, "Autosprite shader %s had odd index count\n", tess.shader->name );
 	}
 
 	oldVerts = tess.numVertexes;

Modified: trunk/code/ui/ui_main.c
===================================================================
--- trunk/code/ui/ui_main.c	2010-08-29 16:49:42 UTC (rev 1789)
+++ trunk/code/ui/ui_main.c	2010-08-29 17:32:54 UTC (rev 1790)
@@ -116,7 +116,7 @@
 static char* netnames[] = {
 	"???",
 	"UDP",
-	NULL
+	"UDP6"
 };
 
 #ifndef MISSIONPACK
@@ -941,7 +941,7 @@
 
 	handle = trap_PC_LoadSource( menuFile );
 	if (!handle) {
-		trap_Error( va( S_COLOR_YELLOW "menu file not found: %s, using default\n", menuFile ) );
+		Com_Printf( S_COLOR_YELLOW "menu file not found: %s, using default\n", menuFile );
 		handle = trap_PC_LoadSource( "ui/menus.txt" );
 		if (!handle) {
 			trap_Error( va( S_COLOR_RED "default menu file not found: ui/menus.txt, unable to continue!\n") );
@@ -2265,7 +2265,7 @@
 		}
     if (h > 100) {
       h = 5;
-    } else if (h < 0) {
+    } else if (h < 5) {
 			h = 100;
 		}
   	trap_Cvar_Set( "handicap", va( "%i", h) );
@@ -4307,9 +4307,15 @@
 						return Info_ValueForKey(info, "addr");
 					} else {
 						if ( ui_netSource.integer == AS_LOCAL ) {
+							int nettype = atoi(Info_ValueForKey(info, "nettype"));
+
+							if (nettype < 0 || nettype >= ARRAY_LEN(netnames)) {
+								nettype = 0;
+							}
+
 							Com_sprintf( hostname, sizeof(hostname), "%s [%s]",
 											Info_ValueForKey(info, "hostname"),
-											netnames[atoi(Info_ValueForKey(info, "nettype"))] );
+											netnames[nettype] );
 							return hostname;
 						}
 						else {



More information about the quake3-commits mailing list