diff -urN --exclude=.svn et260/src/cgame/cg_consolecmds.c etpub/src/cgame/cg_consolecmds.c --- et260/src/cgame/cg_consolecmds.c 2005-04-12 12:11:49.000000000 -0500 +++ etpub/src/cgame/cg_consolecmds.c 2005-05-18 17:28:30.000000000 -0500 @@ -1074,8 +1074,10 @@ // trap_AddCommand ("kill"); trap_AddCommand ("say"); - trap_AddCommand ("say_limbo"); // NERVE - SMF - trap_AddCommand ("tell"); + // CHRUKER: b011 - Doesn't exist + //trap_AddCommand ("say_limbo"); + // CHRUKER: b011 - Doesn't exist + //trap_AddCommand ("tell"); trap_AddCommand ("listbotgoals"); trap_AddCommand ("give"); trap_AddCommand ("god"); @@ -1083,7 +1085,8 @@ trap_AddCommand ("noclip"); trap_AddCommand ("team"); trap_AddCommand ("follow"); - trap_AddCommand ("addbot"); + // CHRUKER: b011 - Not activated + //trap_AddCommand ("addbot"); trap_AddCommand ("setviewpos"); trap_AddCommand ("callvote"); trap_AddCommand ("vote"); @@ -1103,7 +1106,8 @@ trap_AddCommand("?"); trap_AddCommand("bottomshots"); trap_AddCommand("commands"); - trap_AddCommand("follow"); + // CHRUKER: b011 - Duplicate, look further up + //trap_AddCommand("follow"); trap_AddCommand("lock"); #ifdef MV_SUPPORT trap_AddCommand("mvadd"); @@ -1136,22 +1140,45 @@ // OSP trap_AddCommand ("fireteam"); - trap_AddCommand ("buddylist"); + // CHRUKER: b011 - Doesn't exist + //trap_AddCommand ("buddylist"); trap_AddCommand ("showstats"); trap_AddCommand ("ignore"); trap_AddCommand ("unignore"); - trap_AddCommand ("addtt"); - trap_AddCommand ("selectbuddy"); - trap_AddCommand ("selectNextBuddy"); // xkan 9/26/2002 + // CHRUKER: b011 - Doesn't exist + //trap_AddCommand ("addtt"); + // CHRUKER: b011 - Duplicate of an existing client side command + //trap_AddCommand ("selectbuddy"); + // CHRUKER: b011 - Doesn't exist + //trap_AddCommand ("selectNextBuddy"); // xkan 9/26/2002 +#ifdef SAVEGAME_SUPPORT + // CHRUKER: b011 - Only available with savegame support trap_AddCommand ("loadgame"); trap_AddCommand ("savegame"); +#endif trap_AddCommand ("campaign"); trap_AddCommand ("listcampaigns"); - - trap_AddCommand ("setweapons"); - trap_AddCommand ("setclass"); + // CHRUKER: b011 - Doesn't exist + //trap_AddCommand ("setweapons"); + // CHRUKER: b011 - Doesn't exist + //trap_AddCommand ("setclass"); + + // CHRUKER: b011 - Missing commands + trap_AddCommand ("imready"); + trap_AddCommand ("say_buddy"); + trap_AddCommand ("setspawnpt"); + trap_AddCommand ("vsay"); + trap_AddCommand ("vsay_buddy"); + trap_AddCommand ("vsay_team"); + trap_AddCommand ("where"); + + // tjw: remove engine commands + trap_RemoveCommand("+lookup"); + trap_RemoveCommand("-lookup"); + trap_RemoveCommand("+lookdown"); + trap_RemoveCommand("-lookdown"); } diff -urN --exclude=.svn et260/src/cgame/cg_debriefing.c etpub/src/cgame/cg_debriefing.c --- et260/src/cgame/cg_debriefing.c 2005-04-12 12:11:49.000000000 -0500 +++ etpub/src/cgame/cg_debriefing.c 2005-05-11 16:20:51.000000000 -0500 @@ -2534,13 +2534,20 @@ w = CG_Text_Width_Ext( cgs.campaignData.arenas[i].longname, 0.2f, 0, &cgs.media.limboFont2 ); - if( x + 10 + w > button->rect.x + button->rect.w ) { - CG_FillRect( x - w - 12 + 1, y - 6 + 1, 12 + w, 12, colourFadedBlack ); - CG_FillRect( x - w - 12, y - 6, 12 + w, 12, colorBlack ); + // CHRUKER: b049 - Correct placement of the map name + // Pin half width is 12 + // Pin left margin is 3 + // Pin right margin is 0 + // Text margin is 2 + if( x + 14 + w > button->rect.x + button->rect.w ) { + // x - pinhwidth (12) - pin left margin (3) - w - text margin (2) => x - w - 17 + CG_FillRect( x - w - 17 + 1, y - 6 + 1, 17 + w, 12, colourFadedBlack ); + CG_FillRect( x - w - 17, y - 6, 17 + w, 12, colorBlack ); } else { - CG_FillRect( x + 1, y - 6 + 1, 12 + w, 12, colourFadedBlack ); - CG_FillRect( x, y - 6, 12 + w, 12, colorBlack ); - } + // Width = pinhwidth (12) + pin right margin (0) + w + text margin (2) = 14 + w + CG_FillRect( x + 1, y - 6 + 1, 14 + w, 12, colourFadedBlack ); + CG_FillRect( x, y - 6, 14 + w, 12, colorBlack ); + } // b049 switch( CG_Debriefing_FindWinningTeamForPos( i + 1 ) ) { case TEAM_AXIS: @@ -2553,12 +2560,14 @@ CG_DrawPic( x - 12, y - 12, 24, 24, trap_R_RegisterShaderNoMip( "gfx/loading/pin_neutral" ) ); break; } - - if( x + 10 + w > button->rect.x + button->rect.w ) { - CG_Text_Paint_Ext( x - w - 10, y + 3, 0.2f, 0.2f, colorWhite, cgs.campaignData.arenas[i].longname, 0, 0, 0, &cgs.media.limboFont2 ); + // CHRUKER: b049 - Correct placement of the map name + if( x + 14 + w > button->rect.x + button->rect.w ) { + // x - pinhwidth (12) - pin left margin (3) - w => x - w - 15 + CG_Text_Paint_Ext( x - w - 15, y + 3, 0.2f, 0.2f, colorWhite, cgs.campaignData.arenas[i].longname, 0, 0, 0, &cgs.media.limboFont2 ); } else { - CG_Text_Paint_Ext( x + 10, y + 3, 0.2f, 0.2f, colorWhite, cgs.campaignData.arenas[i].longname, 0, 0, 0, &cgs.media.limboFont2 ); - } + // x + pinhwidth (12) + pin right margin (0) => x + 12 + CG_Text_Paint_Ext( x + 12, y + 3, 0.2f, 0.2f, colorWhite, cgs.campaignData.arenas[i].longname, 0, 0, 0, &cgs.media.limboFont2 ); + } // b049 } if( cgs.tdbSelectedMap ) { @@ -2619,13 +2628,20 @@ w = CG_Text_Width_Ext( cgs.arenaData.longname, 0.2f, 0, &cgs.media.limboFont2 ); - if( x + 10 + w > button->rect.x + button->rect.w ) { - CG_FillRect( x - w - 12 + 1, y - 6 + 1, 12 + w, 12, colourFadedBlack ); - CG_FillRect( x - w - 12, y - 6, 12 + w, 12, colorBlack ); + // CHRUKER: b049 - Correct placement of the map name + // Pin half width is 12 + // Pin left margin is 3 + // Pin right margin is 0 + // Text margin is 2 + if( x + 14 + w > button->rect.x + button->rect.w ) { + // x - pinhwidth (12) - pin left margin (3) - w - text margin (2) => x - w - 17 + CG_FillRect( x - w - 17 + 1, y - 6 + 1, 17 + w, 12, colourFadedBlack ); + CG_FillRect( x - w - 17, y - 6, 17 + w, 12, colorBlack ); } else { - CG_FillRect( x + 1, y - 6 + 1, 12 + w, 12, colourFadedBlack ); - CG_FillRect( x, y - 6, 12 + w, 12, colorBlack ); - } + // Width = pinhwidht (12) + pin right margin (0) + w + text margin (2) = 14 + w + CG_FillRect( x + 1, y - 6 + 1, 14 + w, 12, colourFadedBlack ); + CG_FillRect( x, y - 6, 14 + w, 12, colorBlack ); + } // b049 switch( CG_Debriefing_FindWinningTeam() ) { case TEAM_AXIS: @@ -2639,11 +2655,14 @@ break; } - if( x + 10 + w > button->rect.x + button->rect.w ) { - CG_Text_Paint_Ext( x - w - 10, y + 3, 0.2f, 0.2f, colorWhite, cgs.arenaData.longname, 0, 0, 0, &cgs.media.limboFont2 ); + // CHRUKER: b049 - Correct placement of the map name + if( x + 14 + w > button->rect.x + button->rect.w ) { + // x - pinhwidth (12) - pin left margin (3) - w => x - w - 15 + CG_Text_Paint_Ext( x - w - 15, y + 3, 0.2f, 0.2f, colorWhite, cgs.arenaData.longname, 0, 0, 0, &cgs.media.limboFont2 ); } else { - CG_Text_Paint_Ext( x + 10, y + 3, 0.2f, 0.2f, colorWhite, cgs.arenaData.longname, 0, 0, 0, &cgs.media.limboFont2 ); - } + // x + pinhwidth (12) + pin right margin (0) => x + 12 + CG_Text_Paint_Ext( x + 12, y + 3, 0.2f, 0.2f, colorWhite, cgs.arenaData.longname, 0, 0, 0, &cgs.media.limboFont2 ); + } // b049 } else { CG_DrawPic( button->rect.x, button->rect.y, button->rect.w, button->rect.h, trap_R_RegisterShaderNoMip( "menu/art/unknownmap" ) ); } diff -urN --exclude=.svn et260/src/cgame/cg_draw.c etpub/src/cgame/cg_draw.c --- et260/src/cgame/cg_draw.c 2005-04-12 12:11:49.000000000 -0500 +++ etpub/src/cgame/cg_draw.c 2005-05-17 09:21:54.000000000 -0500 @@ -481,9 +481,17 @@ vec4_t color = { 0.625f, 0.625f, 0.6f, 1.0f }; vec4_t timerBackground = { 0.16f, 0.2f, 0.17f, 0.8f }; vec4_t timerBorder = { 0.5f, 0.5f, 0.5f, 0.5f }; + // CHRUKER: b018 - Respawn timer shouldn't be shown in spectator mode + rt = ""; + if(cgs.gametype != GT_WOLF_LMS && + cg_drawReinforcementTime.integer > 0 && + cgs.clientinfo[cg.clientNum].team != TEAM_SPECTATOR) { + + rt = va("^F%d%s", CG_CalculateReinfTime( qfalse ), + ((cgs.timelimit <= 0.0f) ? "" : " ")) ; + - rt = (cgs.gametype != GT_WOLF_LMS && cg_drawReinforcementTime.integer > 0) ? - va("^F%d%s", CG_CalculateReinfTime( qfalse ), ((cgs.timelimit <= 0.0f) ? "" : " ")) : ""; + } msec = ( cgs.timelimit * 60.f * 1000.f ) - ( cg.time - cgs.levelStartTime ); @@ -556,17 +564,13 @@ static void CG_DrawUpperRight( void ) { float y; - if( !cg_drawFireteamOverlay.integer ) { - return; - } - y = 20 + 100 + 32; - if(CG_IsOnFireteam( cg.clientNum )) { + // CHRUKER: b008 - Round timer and respawn timer gone when + // cg_drawFireteamOverlay + if(cg_drawFireteamOverlay.integer && CG_IsOnFireteam(cg.clientNum)) { rectDef_t rect = { 10, 10, 100, 100 }; CG_DrawFireTeamOverlay( &rect ); - } else { -// CG_DrawTeamOverlay( 0 ); } if( !( cg.snap->ps.pm_flags & PMF_LIMBO ) && ( cg.snap->ps.persistant[PERS_TEAM] != TEAM_SPECTATOR ) && @@ -2585,6 +2589,10 @@ if ( ps->stats[STAT_HEALTH] > 0 ) { return; } + + if(ps->eFlags & EF_PLAYDEAD) { + return; + } if( cg.snap->ps.pm_flags & PMF_LIMBO || cgs.clientinfo[cg.clientNum].team == TEAM_SPECTATOR ) { return; diff -urN --exclude=.svn et260/src/cgame/cg_ents.c etpub/src/cgame/cg_ents.c --- et260/src/cgame/cg_ents.c 2005-04-12 12:11:49.000000000 -0500 +++ etpub/src/cgame/cg_ents.c 2005-04-15 12:04:46.000000000 -0500 @@ -345,8 +345,6 @@ } -void CG_RailTrail2( clientInfo_t *ci, vec3_t start, vec3_t end); - /* ================== CG_General @@ -2533,8 +2531,6 @@ return qtrue; } -void CG_RailTrail2( clientInfo_t *ci, vec3_t start, vec3_t end); - /* ================== CG_AddEntityToTag diff -urN --exclude=.svn et260/src/cgame/cg_loadpanel.c etpub/src/cgame/cg_loadpanel.c --- et260/src/cgame/cg_loadpanel.c 2005-04-12 12:11:49.000000000 -0500 +++ etpub/src/cgame/cg_loadpanel.c 2005-05-11 16:26:22.000000000 -0500 @@ -531,30 +531,35 @@ void CG_LoadPanel_DrawPin( const char* text, float px, float py, float sx, float sy, qhandle_t shader, float pinsize, float backheight ) { - float x, y, w, h; + float x, w; vec4_t colourFadedBlack = { 0.f, 0.f, 0.f, 0.4f }; w = DC->textWidthExt( text, sx, 0, &bg_loadscreenfont2 ); - if( px + 30 + w > 440 ) { - DC->fillRect( px - w - 28 + 2, py - (backheight/2.f) + 2, 28 + w, backheight, colourFadedBlack ); - DC->fillRect( px - w - 28, py - (backheight/2.f), 28 + w, backheight, colorBlack ); + + // CHRUKER: b049 - Correct placement of the map name + // Pin half width is 16 + // Pin left margin is 4 + // Pin right margin is 0 + // Text margin is 4 + if( px + 20 + w > 440 ) { + // x - pinhwidth (16) - pin left margin (4) - w - text margin (4) => x - w - 24 + DC->fillRect( px - w - 24 + 2, py - (backheight/2.f) + 2, 24 + w, backheight, colourFadedBlack ); + DC->fillRect( px - w - 24, py - (backheight/2.f), 24 + w, backheight, colorBlack ); } else { - DC->fillRect( px + 2, py - (backheight/2.f) + 2, 28 + w, backheight, colourFadedBlack ); - DC->fillRect( px, py - (backheight/2.f), 28 + w, backheight, colorBlack ); + // Width = pinhwidht (16) + pin right margin (0) + w + text margin (4) = 20 + w + DC->fillRect( px + 2, py - (backheight/2.f) + 2, 20 + w, backheight, colourFadedBlack ); + DC->fillRect( px, py - (backheight/2.f), 20 + w, backheight, colorBlack ); } - x = px - pinsize; - y = py - pinsize; - w = pinsize * 2.f; - h = pinsize * 2.f; - - DC->drawHandlePic( x, y, w, h, shader ); + DC->drawHandlePic(px - pinsize, py - pinsize, pinsize * 2.f, pinsize * 2.f, shader ); - if( px + 30 + w > 440 ) { - DC->drawTextExt( px - 12 - w - 28, py + 4, sx, sy, colorWhite, text, 0, 0, 0, &bg_loadscreenfont2 ); + if( px + 20 + w > 440 ) { + // x - pinhwidth (16) - pin left margin (4) - w => x - w - 20 + DC->drawTextExt( px - 12 - w - 20, py + 4, sx, sy, colorWhite, text, 0, 0, 0, &bg_loadscreenfont2 ); } else { + // x + pinhwidth (16) + pin right margin (0) => x + 16 DC->drawTextExt( px + 16, py + 4, sx, sy, colorWhite, text, 0, 0, 0, &bg_loadscreenfont2 ); - } + } // b049 } void CG_LoadPanel_RenderCampaignPins( panel_button_t* button ) { diff -urN --exclude=.svn et260/src/cgame/cg_local.h etpub/src/cgame/cg_local.h --- et260/src/cgame/cg_local.h 2005-04-12 12:11:49.000000000 -0500 +++ etpub/src/cgame/cg_local.h 2005-05-18 17:27:17.000000000 -0500 @@ -2831,6 +2831,8 @@ // FIXME: replace this with a normal console command "defineCommand"? void trap_AddCommand( const char *cmdName ); +void trap_RemoveCommand( const char *cmdName ); + // send a string to the server over the network void trap_SendClientCommand( const char *s ); diff -urN --exclude=.svn et260/src/cgame/cg_popupmessages.c etpub/src/cgame/cg_popupmessages.c --- et260/src/cgame/cg_popupmessages.c 2005-04-12 12:11:49.000000000 -0500 +++ etpub/src/cgame/cg_popupmessages.c 2005-05-11 11:39:05.000000000 -0500 @@ -443,6 +443,10 @@ } break; case PM_MINES: + // CHRUKER: b009 - Prevent spectators from being + // informed when a mine is spotted + if(cgs.clientinfo[cg.clientNum].team == TEAM_SPECTATOR) + return NULL; if( cgs.clientinfo[cg.clientNum].team == cent->currentState.effect2Time ) { return NULL; } @@ -502,6 +506,10 @@ } break; case PM_MINES: + // CHRUKER: b009 - Prevent spectators from being + // informed when a mine is spotted + if(cgs.clientinfo[cg.clientNum].team == TEAM_SPECTATOR) + return; if( cgs.clientinfo[cg.clientNum].team != cent->currentState.effect2Time ) { // inverted teams if( cent->currentState.effect2Time == TEAM_AXIS ) { diff -urN --exclude=.svn et260/src/cgame/cg_predict.c etpub/src/cgame/cg_predict.c --- et260/src/cgame/cg_predict.c 2005-04-12 12:11:49.000000000 -0500 +++ etpub/src/cgame/cg_predict.c 2005-05-16 19:29:19.000000000 -0500 @@ -539,17 +539,20 @@ CG_TouchItem( cent ); continue; } - - if ( ent->solid != SOLID_BMODEL ) { - continue; - } - - // Gordon: er, this lookup was wrong... - cmodel = cgs.inlineDrawModel[ ent->modelindex ]; -// cmodel = trap_CM_InlineModel( ent->modelindex ); - if ( !cmodel ) { - continue; + + if(!(ent->eFlags & EF_FAKEBMODEL)) { + if(ent->solid != SOLID_BMODEL) { + continue; + } + + // Gordon: er, this lookup was wrong... + cmodel = cgs.inlineDrawModel[ ent->modelindex ]; + //cmodel = trap_CM_InlineModel( ent->modelindex ); + if ( !cmodel ) { + continue; + } } + if( ent->eType == ET_CONSTRUCTIBLE || ent->eType == ET_OID_TRIGGER @@ -565,7 +568,14 @@ continue; } - trap_R_ModelBounds( cmodel, mins, maxs ); + if(ent->eFlags & EF_FAKEBMODEL) { + // tjw: cheap I know + VectorSet(maxs, 32, 32, 60); + VectorSet(mins, -32, -32, 0); + } + else { + trap_R_ModelBounds( cmodel, mins, maxs ); + } VectorAdd( cent->lerpOrigin, mins, mins ); VectorAdd( cent->lerpOrigin, maxs, maxs ); diff -urN --exclude=.svn et260/src/cgame/cg_scoreboard.c etpub/src/cgame/cg_scoreboard.c --- et260/src/cgame/cg_scoreboard.c 2005-04-12 12:11:49.000000000 -0500 +++ etpub/src/cgame/cg_scoreboard.c 2005-05-11 11:39:05.000000000 -0500 @@ -280,7 +280,15 @@ Q_strcat( buf, sizeof(buf), va( "^%c%c", COLOR_RED + i, skillNames[i][0] ) ); } maxchars--; - CG_DrawStringExt( tempx + (BG_drawStrlen(ci->name) * SMALLCHAR_WIDTH + SMALLCHAR_WIDTH), y, buf, hcolor, qfalse, qfalse, SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, maxchars ); + // CHRUKER: b032 - Medals clipped wrong in scoreboard when you're + // dead, because CG_DrawStringExt will draw + // everything if maxchars <= 0 + if (maxchars > 0) { + CG_DrawStringExt( tempx + (BG_drawStrlen(ci->name) * + SMALLCHAR_WIDTH + SMALLCHAR_WIDTH), y, buf, hcolor, + qfalse, qfalse, SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, + maxchars ); + } tempx += INFO_PLAYER_WIDTH - offset; @@ -290,7 +298,13 @@ totalwidth = INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH - 8; - s = CG_TranslateString( "^3SPECTATOR" ); + // CHRUKER: b031 - Show connecting people as connecting + if (score->ping == -1) { + s = CG_TranslateString( "^3CONNECTING" ); + } + else { + s = CG_TranslateString( "^3SPECTATOR" ); + } w = CG_DrawStrlen( s ) * SMALLCHAR_WIDTH; CG_DrawSmallString( tempx + totalwidth - w, y, s, fade ); @@ -339,8 +353,13 @@ float tempx; vec4_t hcolor; clientInfo_t *ci; - - if ( y + SMALLCHAR_HEIGHT >= 470 ) + // CHRUKER: b033 - Added to draw medals + int i, j; + char buf[64]; + + // CHRUKER: b033 - Was using the wrong char height for this + // calculation + if ( y + MINICHAR_HEIGHT >= 470 ) return; ci = &cgs.clientinfo[score->client]; @@ -388,7 +407,8 @@ VectorSet( hcolor, 1, 1, 1 ); hcolor[3] = fade; - maxchars = 17; + // CHRUKER: b033 - Corrected to draw medals + maxchars = 16; offset = 0; if ( ci->team != TEAM_SPECTATOR ) { @@ -415,6 +435,20 @@ // draw name CG_DrawStringExt( tempx, y, ci->name, hcolor, qfalse, qfalse, MINICHAR_WIDTH, MINICHAR_HEIGHT, maxchars ); + + // CHRUKER: b033 - Added to draw medals + maxchars -= CG_DrawStrlen( ci->name ); + + buf[0] = '\0'; + for( i = 0; i < SK_NUM_SKILLS; i++ ) { + for( j = 0; j < ci->medals[i]; j++ ) + Q_strcat( buf, sizeof(buf), va( "^%c%c", COLOR_RED + i, skillNames[i][0] ) ); + } + maxchars--; + + if (maxchars > 0) CG_DrawStringExt( tempx + (BG_drawStrlen(ci->name) * MINICHAR_WIDTH + MINICHAR_WIDTH), y, buf, hcolor, qfalse, qfalse, MINICHAR_WIDTH, MINICHAR_HEIGHT, maxchars ); + // b033 + tempx += INFO_PLAYER_WIDTH - offset; // dhm - nerve @@ -424,10 +458,17 @@ totalwidth = INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH - 8; - s = CG_TranslateString( "^3SPECTATOR" ); + // CHRUKER: b031 - Show connecting people as connecting + if (score->ping == -1) { + s = CG_TranslateString( "^3CONNECTING" ); + } + else { + s = CG_TranslateString( "^3SPECTATOR" ); + } w = CG_DrawStrlen( s ) * MINICHAR_WIDTH; - - CG_DrawSmallString( tempx + totalwidth - w, y, s, fade ); + // CHRUKER: b034 - Using the mini char height + CG_DrawStringExt( tempx + totalwidth - w, y, s, hcolor, qfalse, + qfalse, MINICHAR_WIDTH, MINICHAR_HEIGHT, 0 ); return; } else if ( cg.snap->ps.persistant[PERS_TEAM] == ci->team ) { @@ -506,12 +547,15 @@ return y + INFO_LINE_HEIGHT + 6; } -static int WM_TeamScoreboard( int x, int y, team_t team, float fade, int maxrows ) { +// CHRUKER: b035 - Added absolute maximum rows +static int WM_TeamScoreboard( int x, int y, team_t team, float fade, int maxrows, int absmaxrows ) { vec4_t hcolor; float tempx, tempy; int height, width; int i; int count = 0; + // CHRUKER: b035 - Needed to check if using mini chars + qboolean use_mini_chars = qfalse; vec4_t tclr = { 0.6f, 0.6f, 0.6f, 1.0f }; height = SMALLCHAR_HEIGHT * maxrows; @@ -547,28 +591,6 @@ y += SMALLCHAR_HEIGHT + 3; - // save off y val - tempy = y; - - // draw color bands - for ( i = 0; i <= maxrows; i++ ) { - if ( i % 2 == 0 ) - VectorSet( hcolor, (80.f/255.f), (80.f/255.f), (80.f/255.f) ); // LIGHT BLUE - else - VectorSet( hcolor, (0.f/255.f), (0.f/255.f), (0.f/255.f) ); // DARK BLUE - hcolor[3] = fade * 0.3; - - CG_FillRect( x-5, y, width+5, SMALLCHAR_HEIGHT+1, hcolor ); - trap_R_SetColor( colorBlack ); - CG_DrawTopBottom( x-5, y, width+5, SMALLCHAR_HEIGHT+1, 1 ); - trap_R_SetColor( NULL ); - - y += SMALLCHAR_HEIGHT; - } - hcolor[3] = 1; - - y = tempy; - tempx = x; CG_FillRect( x-5, y-1, width+5, 18, clrUiBack ); @@ -603,10 +625,6 @@ y += SMALLCHAR_HEIGHT; - // draw player info - VectorSet( hcolor, 1, 1, 1 ); - hcolor[3] = fade; - cg.teamPlayers[team] = 0; // JPW NERVE for ( i = 0; i < cg.numScores; i++ ) { if ( team != cgs.clientinfo[ cg.scores[i].client ].team ) @@ -615,13 +633,57 @@ cg.teamPlayers[team]++; } + // CHRUKER: b035 - Adjust maxrows + if ( cg.teamPlayers[team] > maxrows ) { + if (maxrows == 9) maxrows = absmaxrows; + if (maxrows == 25) maxrows = absmaxrows; + use_mini_chars = qtrue; + } + + // save off y val + tempy = y; + + // draw color bands + for ( i = 0; i < maxrows; i++ ) { + if ( i % 2 == 0 ) + VectorSet( hcolor, (80.f/255.f), (80.f/255.f), (80.f/255.f) ); // LIGHT BLUE + else + VectorSet( hcolor, (0.f/255.f), (0.f/255.f), (0.f/255.f) ); // DARK BLUE + hcolor[3] = fade * 0.3; + + // CHRUKER: b035 - Missing support for mini char height scoreboard background + if ( use_mini_chars ) { + CG_FillRect( x-5, y, width+5, MINICHAR_HEIGHT+1, hcolor ); + trap_R_SetColor( colorBlack ); + CG_DrawTopBottom( x-5, y, width+5, MINICHAR_HEIGHT+1, 1 ); + trap_R_SetColor( NULL ); + + y += MINICHAR_HEIGHT; + } else { + CG_FillRect( x-5, y, width+5, SMALLCHAR_HEIGHT+1, hcolor ); + trap_R_SetColor( colorBlack ); + CG_DrawTopBottom( x-5, y, width+5, SMALLCHAR_HEIGHT+1, 1 ); + trap_R_SetColor( NULL ); + + y += SMALLCHAR_HEIGHT; + } + } + + hcolor[3] = 1; + + y = tempy; + + // draw player info + VectorSet( hcolor, 1, 1, 1 ); + hcolor[3] = fade; + count = 0; for( i = 0; i < cg.numScores && count < maxrows; i++ ) { if( team != cgs.clientinfo[ cg.scores[i].client ].team ) { continue; } - - if( cg.teamPlayers[team] > maxrows ) { + // CHRUKER: b035 - Using the flag instead + if(use_mini_chars) { WM_DrawClientScore_Small( x, y, &cg.scores[i], hcolor, fade ); y += MINICHAR_HEIGHT; } else { @@ -633,7 +695,11 @@ } // draw spectators - y += SMALLCHAR_HEIGHT; + // CHRUKER: b035 - Missing support for mini char height scoreboard background + if ( use_mini_chars ) + y += MINICHAR_HEIGHT; + else + y += SMALLCHAR_HEIGHT; for ( i = 0; i < cg.numScores; i++ ) { if ( cgs.clientinfo[ cg.scores[i].client ].team != TEAM_SPECTATOR ) @@ -642,9 +708,14 @@ continue; if ( team == TEAM_ALLIES && ( ( i + 1 ) % 2 ) ) continue; - - WM_DrawClientScore( x, y, &cg.scores[i], hcolor, fade ); - y += SMALLCHAR_HEIGHT; + // CHRUKER: b035 - Missing support for mini char height scoreboard background + if( use_mini_chars ) { + WM_DrawClientScore_Small( x, y, &cg.scores[i], hcolor, fade ); + y += MINICHAR_HEIGHT; + } else { + WM_DrawClientScore( x, y, &cg.scores[i], hcolor, fade ); + y += SMALLCHAR_HEIGHT; + } } return y; @@ -702,19 +773,21 @@ if ( cgs.gametype == GT_WOLF_STOPWATCH && ( cg.snap->ps.pm_type == PM_INTERMISSION ) ) { y = WM_DrawInfoLine( x, 155, fade ); - - WM_TeamScoreboard( x, y, TEAM_AXIS, fade, 8 ); + // CHRUKER: b035 - The maxrows has been split into one for + // when to use the mini chars and one for when + // to stop writing. + WM_TeamScoreboard( x, y, TEAM_AXIS, fade, 8, 8 ); x = x_right; - WM_TeamScoreboard( x, y, TEAM_ALLIES, fade, 8 ); + WM_TeamScoreboard( x, y, TEAM_ALLIES, fade, 8, 8 ); } else { if(cg.snap->ps.pm_type == PM_INTERMISSION) { - WM_TeamScoreboard( x, y, TEAM_AXIS, fade, 9 ); + WM_TeamScoreboard( x, y, TEAM_AXIS, fade, 9, 12 ); x = x_right; - WM_TeamScoreboard( x, y, TEAM_ALLIES, fade, 9 ); + WM_TeamScoreboard( x, y, TEAM_ALLIES, fade, 9, 12 ); } else { - WM_TeamScoreboard( x, y, TEAM_AXIS, fade, 25 ); + WM_TeamScoreboard( x, y, TEAM_AXIS, fade, 25, 33 ); x = x_right; - WM_TeamScoreboard( x, y, TEAM_ALLIES, fade, 25 ); + WM_TeamScoreboard( x, y, TEAM_ALLIES, fade, 25, 33 ); } } diff -urN --exclude=.svn et260/src/cgame/cg_servercmds.c etpub/src/cgame/cg_servercmds.c --- et260/src/cgame/cg_servercmds.c 2005-04-12 12:11:49.000000000 -0500 +++ etpub/src/cgame/cg_servercmds.c 2005-05-19 12:40:22.000000000 -0500 @@ -9,6 +9,17 @@ void CG_LimboMenu_f(); +static void CG_ForceCvar() { + const char *cvarName, *cvarValue; + + cvarName = CG_Argv(1); + if(!*cvarName) + return; + cvarValue = CG_Argv(2); + trap_Cvar_Set(cvarName, cvarValue); +} + + /* ================= CG_ParseScores @@ -1655,13 +1666,16 @@ if(ci->skill[i] < NUM_SKILL_LEVELS - 1) { str = va("%4d/%-4d", ci->skillpoints[i], skillLevels[ci->skill[i]+1]); } else { - str = va("%d", ci->skillpoints[i]); + // CHRUKER: b023 - Fixing indentation + str = va(" %d", ci->skillpoints[i]); } if(cgs.gametype == GT_WOLF_CAMPAIGN) { - Q_strncpyz(gs->strSkillz[gs->cSkills++], va("%-15s %3d %s %12d", skillNames[i], ci->skill[i], str, ci->medals[i]), sizeof(gs->strSkillz[0])); + // CHRUKER: b023 - Fixing indentation + Q_strncpyz(gs->strSkillz[gs->cSkills++], va("%-15s %3d %-15s %6d", skillNames[i], ci->skill[i], str, ci->medals[i]), sizeof(gs->strSkillz[0])); } else { - Q_strncpyz(gs->strSkillz[gs->cSkills++], va("%-15s %3d %s", skillNames[i], ci->skill[i], str), sizeof(gs->strSkillz[0])); + // CHRUKER: b023 - Fixing indentation + Q_strncpyz(gs->strSkillz[gs->cSkills++], va("%-15s %3d %-15s", skillNames[i], ci->skill[i], str), sizeof(gs->strSkillz[0])); } } } @@ -1680,7 +1694,9 @@ unsigned int nClient = atoi(CG_Argv(iArg++)); unsigned int nRounds = atoi(CG_Argv(iArg++)); unsigned int dwWeaponMask = atoi(CG_Argv(iArg++)); - unsigned int dwSkillPointMask, xp = 0; + unsigned int dwSkillPointMask; + // CHRUKER: b037 - Negative XP wouldn't show up on the playerstat screen + int xp = 0; ci = &cgs.clientinfo[nClient]; @@ -2403,6 +2419,11 @@ return; } + + if(!Q_stricmp(cmd, "forcecvar")) { + CG_ForceCvar(); + return; + } if( CG_Debriefing_ServerCommand( cmd ) ) { return; diff -urN --exclude=.svn et260/src/cgame/cg_syscalls.c etpub/src/cgame/cg_syscalls.c --- et260/src/cgame/cg_syscalls.c 2005-04-12 12:11:49.000000000 -0500 +++ etpub/src/cgame/cg_syscalls.c 2005-05-18 17:26:45.000000000 -0500 @@ -112,6 +112,10 @@ syscall( CG_ADDCOMMAND, cmdName ); } +void trap_RemoveCommand( const char *cmdName ) { + syscall( CG_REMOVECOMMAND, cmdName ); +} + void trap_SendClientCommand( const char *s ) { syscall( CG_SENDCLIENTCOMMAND, s ); } diff -urN --exclude=.svn et260/src/cgame/cg_weapons.c etpub/src/cgame/cg_weapons.c --- et260/src/cgame/cg_weapons.c 2005-04-12 12:11:49.000000000 -0500 +++ etpub/src/cgame/cg_weapons.c 2005-05-11 11:39:05.000000000 -0500 @@ -809,15 +809,18 @@ VectorCopy( end, re->oldorigin ); // // still allow different colors so we can tell AI shots from player shots, etc. -/* if(ci) { - le->color[0] = ci->color[0] * 0.75; - le->color[1] = ci->color[1] * 0.75; - le->color[2] = ci->color[2] * 0.75; - } else {*/ + if(ci) { + //le->color[0] = ci->color[0] * 0.75; + //le->color[1] = ci->color[1] * 0.75; + //le->color[2] = ci->color[2] * 0.75; + le->color[0] = 0; + le->color[1] = 0; + le->color[2] = 1; + } else { le->color[0] = 1; le->color[1] = 0; le->color[2] = 0; -// } + } le->color[3] = 1.0f; AxisClear( re->axis ); @@ -4229,6 +4232,15 @@ // JPW NERVE -- early out if we just fired Panzerfaust, go to pistola, then grenades if (cg.weaponSelect == WP_PANZERFAUST) { + // CHRUKER: b021 - Actually use a SMG first if we got it + for( i = 0; i < MAX_WEAPS_IN_BANK_MP; i++ ) { + // CHRUKER: b021 - Make sure we don't reselect the panzer. (That took me a while to figure that out :-) + if (weapBanksMultiPlayer[3][i] != WP_PANZERFAUST && CG_WeaponSelectable(weapBanksMultiPlayer[3][i])) { // find a smg + cg.weaponSelect = weapBanksMultiPlayer[3][i]; + CG_FinishWeaponChange(cg.predictedPlayerState.weapon, cg.weaponSelect); + return; + } + } // b021 for( i = 0; i < MAX_WEAPS_IN_BANK_MP; i++ ) { if (CG_WeaponSelectable(weapBanksMultiPlayer[2][i])) { // find a pistol cg.weaponSelect = weapBanksMultiPlayer[2][i]; @@ -4518,6 +4530,111 @@ cg.recoilPitch -= pitchRecoilAdd; } +// josh: For antilag debugging +void CG_DrawHitBoxOnHit( centity_t *cent ) { + vec3_t muzzlePoint, forward, right, up; + entityState_t *ent = ¢->currentState; + trace_t trace; + vec3_t endPoint; + + // if the client isn't us, forget it + if ( cent->currentState.number != cg.predictedPlayerState.clientNum ) { + return; + } + + // get the muzzle point + VectorCopy( cg.predictedPlayerState.origin, muzzlePoint ); + muzzlePoint[2] += cg.predictedPlayerState.viewheight; + + // get forward, right, and up + AngleVectors( cg.predictedPlayerState.viewangles, forward, right, up ); + VectorMA( muzzlePoint, 14, forward, muzzlePoint ); + + // trace forward + VectorMA( muzzlePoint, 8192, forward, endPoint ); + + CG_Trace( &trace, muzzlePoint, vec3_origin, vec3_origin, endPoint, cent->currentState.number, CONTENTS_BODY|CONTENTS_SOLID ); + + // did we hit another player? + if ( trace.fraction < 1.0f && (trace.contents & CONTENTS_BODY) ) { + centity_t *c = &cg_entities[trace.entityNum]; + int x, zd, zu; + vec3_t bmins, bmaxs; + + x = (c->currentState.solid & 255); + zd = ((c->currentState.solid>>8) & 255); + zu = ((c->currentState.solid>>16) & 255) - 32; + + bmins[0] = bmins[1] = -x; + bmaxs[0] = bmaxs[1] = x; + bmins[2] = -zd; + bmaxs[2] = zu; + + VectorAdd( bmins, c->lerpOrigin, bmins ); + VectorAdd( bmaxs, c->lerpOrigin, bmaxs ); + + CG_RailTrail( NULL, bmins, bmaxs, 1 ); + + //// if we have two snapshots (we're interpolating) + if ( cg.nextSnap ) { + centity_t *c = &cg_entities[trace.entityNum]; + vec3_t origin1, origin2; + + // figure the two origins used for interpolation + BG_EvaluateTrajectory( + &c->currentState.pos, + cg.snap->serverTime, + origin1, + qfalse, + c->currentState.effect2Time ); + BG_EvaluateTrajectory( + &c->nextState.pos, + cg.nextSnap->serverTime, + origin2, qfalse, + c->currentState.effect2Time ); + + + // print some debugging stuff exactly like what the server does + + // it starts with "Int:" to let you know the target was interpolated + CG_Printf("^3Int: time: %d, j: %d, k: %d, origin: %0.2f %0.2f %0.2f\n", + cg.oldTime, cg.snap->serverTime, cg.nextSnap->serverTime, + c->lerpOrigin[0], c->lerpOrigin[1], c->lerpOrigin[2]); + CG_Printf("^5frac: %0.4f, origin1: %0.2f %0.2f %0.2f, origin2: %0.2f %0.2f %0.2f\n", + cg.frameInterpolation, + origin1[0], + origin1[1], + origin1[2], + origin2[0], + origin2[1], + origin2[2]); + } + else { + // we haven't got a next snapshot + // the client clock has either drifted ahead (seems to happen once + // per server frame when you play locally) or the client is using + // timenudge. In any case, CG_CalcEntityLerpPositions extrapolated + // rather than interpolated + vec3_t origin1, origin2; + + c->currentState.pos.trType = TR_LINEAR_STOP; + c->currentState.pos.trTime = cg.snap->serverTime; + c->currentState.pos.trDuration = 1000 / 20; //sv_fps.integer; + + BG_EvaluateTrajectory( &c->currentState.pos, cg.snap->serverTime, origin1 , qfalse, c->currentState.effect2Time ); + BG_EvaluateTrajectory( &c->currentState.pos, cg.snap->serverTime + 1000 / 20, origin2 ,qfalse, c->currentState.effect2Time ); // replace 20 with sv_fps.integer if possible later + + // print some debugging stuff exactly like what the server does + + // it starts with "Ext:" to let you know the target was extrapolated + CG_Printf("^3Ext: time: %d, j: %d, k: %d, origin: %0.2f %0.2f %0.2f\n", + cg.oldTime, cg.snap->serverTime, cg.snap->serverTime, + c->lerpOrigin[0], c->lerpOrigin[1], c->lerpOrigin[2]); + CG_Printf("^5frac: %0.4f, origin1: %0.2f %0.2f %0.2f, origin2: %0.2f %0.2f %0.2f\n", + cg.frameInterpolation, origin1[0], origin1[1], origin1[2], origin2[0], origin2[1], origin2[2]); + } + } +} /* ================ @@ -4685,6 +4802,8 @@ weap->ejectBrassFunc( cent ); } } // jpw + if(developer.integer) + CG_DrawHitBoxOnHit( cent ); } diff -urN --exclude=.svn et260/src/ui/ui_main.c etpub/src/ui/ui_main.c --- et260/src/ui/ui_main.c 2005-04-12 12:11:52.000000000 -0500 +++ etpub/src/ui/ui_main.c 2005-05-11 16:32:47.000000000 -0500 @@ -1575,22 +1575,30 @@ y = rect->y + ( ( uiInfo.campaignList[map].mapInfos[i]->mappos[1] - uiInfo.campaignList[map].mapTC[0][1] ) / 650.f * rect->h ); w = Text_Width( uiInfo.campaignList[map].mapInfos[i]->mapName, scale, 0 ); - + // CHRUKER: b049 - Correct placement of the map name + // Pin half width is 8 + // Pin left margin is 2 + // Pin right margin is 0 + // Text margin is 2 if( x + 10 + w > rect->x + rect->w ) { + // x - pinhwidth (8) - pin left margin (2) - w - text margin (2) => x - w - 12 UI_FillRect( x - w - 12 + 1, y - 6 + 1, 12 + w, 12, colourFadedBlack ); UI_FillRect( x - w - 12, y - 6, 12 + w, 12, colorBlack ); } else { - UI_FillRect( x + 1, y - 6 + 1, 12 + w, 12, colourFadedBlack ); - UI_FillRect( x, y - 6, 12 + w, 12, colorBlack ); + // Width = pinhwidht (8) + pin right margin (0) + w + text margin (2) = 10 + w + UI_FillRect( x + 1, y - 6 + 1, 10 + w, 12, colourFadedBlack ); + UI_FillRect( x, y - 6, 10 + w, 12, colorBlack ); } UI_DrawHandlePic( x - 8, y - 8, 16, 16, trap_R_RegisterShaderNoMip( "gfx/loading/pin_neutral" ) ); if( x + 10 + w > rect->x + rect->w ) { + // x - pinhwidth (8) - pin left margin (2) - w => x - w - 10 Text_Paint( x - w - 10, y + 3, scale, colorWhite, uiInfo.campaignList[map].mapInfos[i]->mapName, 0, 0, 0 ); } else { - Text_Paint( x + 10, y + 3, scale, colorWhite, uiInfo.campaignList[map].mapInfos[i]->mapName, 0, 0, 0 ); - } + // x + pinhwidth (8) + pin right margin (0) => x + 8 + Text_Paint( x + 8, y + 3, scale, colorWhite, uiInfo.campaignList[map].mapInfos[i]->mapName, 0, 0, 0 ); + } // b049 } } else { UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, trap_R_RegisterShaderNoMip("levelshots/unknownmap")); @@ -1649,21 +1657,30 @@ w = Text_Width( uiInfo.mapList[map].mapName, scale, 0 ); + // CHRUKER: b049 - Correct placement of the map name + // Pin half width is 8 + // Pin left margin is 2 + // Pin right margin is 0 + // Text margin is 2 if( x + 10 + w > rect->x + rect->w ) { + // x - pinhwidth (8) - pin left margin (2) - w - text margin (2) => x - w - 12 UI_FillRect( x - w - 12 + 1, y - 6 + 1, 12 + w, 12, colourFadedBlack ); UI_FillRect( x - w - 12, y - 6, 12 + w, 12, colorBlack ); } else { - UI_FillRect( x + 1, y - 6 + 1, 12 + w, 12, colourFadedBlack ); - UI_FillRect( x, y - 6, 12 + w, 12, colorBlack ); + // Width = pinhwidht (8) + pin right margin (0) + w + text margin (2) = 10 + w + UI_FillRect( x + 1, y - 6 + 1, 10 + w, 12, colourFadedBlack ); + UI_FillRect( x, y - 6, 10 + w, 12, colorBlack ); } UI_DrawHandlePic( x - 8, y - 8, 16, 16, trap_R_RegisterShaderNoMip( "gfx/loading/pin_neutral" ) ); if( x + 10 + w > rect->x + rect->w ) { + // x - pinhwidth (8) - pin left margin (2) - w => x - w - 10 Text_Paint( x - w - 10, y + 3, scale, colorWhite, uiInfo.mapList[map].mapName, 0, 0, 0 ); } else { - Text_Paint( x + 10, y + 3, scale, colorWhite, uiInfo.mapList[map].mapName, 0, 0, 0 ); - } + // x + pinhwidth (8) + pin right margin (0) => x + 8 + Text_Paint( x + 8, y + 3, scale, colorWhite, uiInfo.mapList[map].mapName, 0, 0, 0 ); + } // b049 } else { UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, trap_R_RegisterShaderNoMip( "levelshots/unknownmap" ) ); }