First batch of bug fixes reported and patched by Zack "ZTurtleMan" Middleton:

#4736
#4730
#4731
#4732
#4733
#4735
#4736
#4737
#4738
#4739
This commit is contained in:
Thilo Schulz 2010-08-29 17:32:54 +00:00
parent 392b246ee9
commit 83a3e2ae1b
6 changed files with 25 additions and 14 deletions

View file

@ -2510,7 +2510,7 @@ int BotWantsToCamp(bot_state_t *bs) {
//if the bot isn't healthy anough //if the bot isn't healthy anough
if (BotAggression(bs) < 50) return qfalse; if (BotAggression(bs) < 50) return qfalse;
//the bot should have at least have the rocket launcher, the railgun or the bfg10k with some ammo //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_RAILGUN] <= 0 || bs->inventory[INVENTORY_SLUGS] < 10) &&
(bs->inventory[INVENTORY_BFG10K] <= 0 || bs->inventory[INVENTORY_BFGAMMO] < 10)) { (bs->inventory[INVENTORY_BFG10K] <= 0 || bs->inventory[INVENTORY_BFGAMMO] < 10)) {
return qfalse; return qfalse;

View file

@ -147,8 +147,8 @@ static char* gamenames[] = {
}; };
static char* netnames[] = { static char* netnames[] = {
"???", "??? ",
"UDP", "UDP ",
"UDP6", "UDP6",
NULL NULL
}; };
@ -534,7 +534,7 @@ static void ArenaServers_UpdateMenu( void ) {
pingColor = S_COLOR_RED; 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->hostname, servernodeptr->mapname, servernodeptr->numclients,
servernodeptr->maxclients, servernodeptr->gamename, servernodeptr->maxclients, servernodeptr->gamename,
netnames[servernodeptr->nettype], pingColor, servernodeptr->pingtime, servernodeptr->bPB ? "Yes" : "No" ); netnames[servernodeptr->nettype], pingColor, servernodeptr->pingtime, servernodeptr->bPB ? "Yes" : "No" );
@ -672,6 +672,9 @@ static void ArenaServers_Insert( char* adrstr, char* info, int pingtime )
} }
*/ */
servernodeptr->nettype = atoi(Info_ValueForKey(info, "nettype")); servernodeptr->nettype = atoi(Info_ValueForKey(info, "nettype"));
if (servernodeptr->nettype < 0 || servernodeptr->nettype >= ARRAY_LEN(netnames)) {
servernodeptr->nettype = 0;
}
s = Info_ValueForKey( info, "game"); s = Info_ValueForKey( info, "game");
i = atoi( Info_ValueForKey( info, "gametype") ); i = atoi( Info_ValueForKey( info, "gametype") );

View file

@ -766,13 +766,13 @@ static void ServerOptions_Start( void ) {
case GT_TEAM: case GT_TEAM:
trap_Cvar_SetValue( "ui_team_fraglimit", fraglimit ); trap_Cvar_SetValue( "ui_team_fraglimit", fraglimit );
trap_Cvar_SetValue( "ui_team_timelimit", timelimit ); trap_Cvar_SetValue( "ui_team_timelimit", timelimit );
trap_Cvar_SetValue( "ui_team_friendlt", friendlyfire ); trap_Cvar_SetValue( "ui_team_friendly", friendlyfire );
break; break;
case GT_CTF: 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_timelimit", timelimit );
trap_Cvar_SetValue( "ui_ctf_friendlt", friendlyfire ); trap_Cvar_SetValue( "ui_ctf_friendly", friendlyfire );
break; break;
} }
@ -1239,7 +1239,7 @@ static void ServerOptions_MenuInit( qboolean multiplayer ) {
memset( &s_serveroptions, 0 ,sizeof(serveroptions_t) ); memset( &s_serveroptions, 0 ,sizeof(serveroptions_t) );
s_serveroptions.multiplayer = multiplayer; 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" ) ); s_serveroptions.punkbuster.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "sv_punkbuster" ) );
ServerOptions_Cache(); ServerOptions_Cache();

View file

@ -191,6 +191,8 @@ typedef int clipHandle_t;
#define MAX_QINT 0x7fffffff #define MAX_QINT 0x7fffffff
#define MIN_QINT (-MAX_QINT-1) #define MIN_QINT (-MAX_QINT-1)
#define ARRAY_LEN(x) (sizeof(x) / sizeof(*x))
// angle indexes // angle indexes
#define PITCH 0 // up / down #define PITCH 0 // up / down

View file

@ -359,10 +359,10 @@ static void AutospriteDeform( void ) {
vec3_t leftDir, upDir; vec3_t leftDir, upDir;
if ( tess.numVertexes & 3 ) { 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 ) { 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; oldVerts = tess.numVertexes;

View file

@ -116,7 +116,7 @@ static const int numSortKeys = sizeof(sortKeys) / sizeof(const char*);
static char* netnames[] = { static char* netnames[] = {
"???", "???",
"UDP", "UDP",
NULL "UDP6"
}; };
#ifndef MISSIONPACK #ifndef MISSIONPACK
@ -941,7 +941,7 @@ void UI_LoadMenus(const char *menuFile, qboolean reset) {
handle = trap_PC_LoadSource( menuFile ); handle = trap_PC_LoadSource( menuFile );
if (!handle) { 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" ); handle = trap_PC_LoadSource( "ui/menus.txt" );
if (!handle) { if (!handle) {
trap_Error( va( S_COLOR_RED "default menu file not found: ui/menus.txt, unable to continue!\n") ); trap_Error( va( S_COLOR_RED "default menu file not found: ui/menus.txt, unable to continue!\n") );
@ -2265,7 +2265,7 @@ static qboolean UI_Handicap_HandleKey(int flags, float *special, int key) {
} }
if (h > 100) { if (h > 100) {
h = 5; h = 5;
} else if (h < 0) { } else if (h < 5) {
h = 100; h = 100;
} }
trap_Cvar_Set( "handicap", va( "%i", h) ); trap_Cvar_Set( "handicap", va( "%i", h) );
@ -4307,9 +4307,15 @@ static const char *UI_FeederItemText(float feederID, int index, int column, qhan
return Info_ValueForKey(info, "addr"); return Info_ValueForKey(info, "addr");
} else { } else {
if ( ui_netSource.integer == AS_LOCAL ) { 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]", Com_sprintf( hostname, sizeof(hostname), "%s [%s]",
Info_ValueForKey(info, "hostname"), Info_ValueForKey(info, "hostname"),
netnames[atoi(Info_ValueForKey(info, "nettype"))] ); netnames[nettype] );
return hostname; return hostname;
} }
else { else {