diff --git a/cl_dll/3wave/CTF_FlagStatus.cpp b/cl_dll/3wave/CTF_FlagStatus.cpp index 61cbe23f..9b3122cc 100644 --- a/cl_dll/3wave/CTF_FlagStatus.cpp +++ b/cl_dll/3wave/CTF_FlagStatus.cpp @@ -218,39 +218,20 @@ int CHudFlagStatus::MsgFunc_FlagStat(const char *pszName, int iSize, void *pbuf) int CHudFlagStatus::MsgFunc_RuneStat(const char *pszName, int iSize, void *pbuf) { - BEGIN_READ( pbuf, iSize ); + BEGIN_READ( pbuf, iSize ); m_iRuneStat = READ_BYTE(); - + return 1; } int CHudFlagStatus::MsgFunc_FlagCarrier(const char *pszName, int iSize, void *pbuf) { - BEGIN_READ( pbuf, iSize ); + BEGIN_READ( pbuf, iSize ); int index = READ_BYTE(); - bool bRedFlag = false; - bool bBlueFlag = false; - - g_PlayerExtraInfo[ index ].iHasFlag = READ_BYTE(); - - for ( int i = 1; i < MAX_PLAYERS + 1; i++ ) - { - if ( g_PlayerExtraInfo[ i ].iHasFlag ) - { - if ( g_PlayerExtraInfo[ i ].teamnumber == 1 ) - bRedFlag = true; - else if ( g_PlayerExtraInfo[ i ].teamnumber == 2 ) - bBlueFlag = true; - } - } - - if ( !bRedFlag ); - //gViewPort->m_pScoreBoard->m_pImages[ 5 ]->setVisible( false ); - if ( !bBlueFlag ); - //gViewPort->m_pScoreBoard->m_pImages[ 4 ]->setVisible( false ); - + g_PlayerExtraInfo[index].iHasFlag = READ_BYTE(); + return 1; } diff --git a/cl_dll/hud.h b/cl_dll/hud.h index 40fc8748..82e0a15a 100644 --- a/cl_dll/hud.h +++ b/cl_dll/hud.h @@ -598,6 +598,9 @@ public: int iRedTeamScore; int iBlueTeamScore; + HSPRITE m_hBlueFlag; + HSPRITE m_hRedFlag; + private: int m_iBlueAtBaseIndex; int m_iBlueFlagIndex; @@ -615,12 +618,10 @@ private: int m_iRune4Index; int m_iRuneStat; - HSPRITE m_hBlueFlag; HSPRITE m_hBlueAtBase; HSPRITE m_hBlueLost; HSPRITE m_hBlueStolen; - HSPRITE m_hRedFlag; HSPRITE m_hRedAtBase; HSPRITE m_hRedLost; HSPRITE m_hRedStolen; diff --git a/cl_dll/scoreboard.cpp b/cl_dll/scoreboard.cpp index 5d52787c..188dface 100644 --- a/cl_dll/scoreboard.cpp +++ b/cl_dll/scoreboard.cpp @@ -427,6 +427,22 @@ int CHudScoreboard::DrawPlayers( int xpos_rel, float list_slot, int nameoffset, FillRGBA( xpos - 5, ypos, FAR_RIGHT, ROW_GAP, 0, 0, 255, 70 ); } + if( g_PlayerExtraInfo[best_player].iHasFlag ) + { + HSPRITE hFlag; + + if( g_PlayerExtraInfo[best_player].teamnumber == 1 ) + { + hFlag = gHUD.m_FlagStat.m_hBlueFlag; + } + else if( g_PlayerExtraInfo[best_player].teamnumber == 2 ) + { + hFlag = gHUD.m_FlagStat.m_hRedFlag; + } + SPR_Set( hFlag, 255, 255, 255 ); + SPR_DrawHoles( 1, xpos, ypos + 5, NULL ); + } + // draw their name (left to right) DrawUtfString( xpos + nameoffset, ypos, NAME_RANGE_MAX + xpos_rel, pl_info->name, r, g, b ); @@ -492,14 +508,14 @@ int CHudScoreboard::MsgFunc_ScoreInfo( const char *pszName, int iSize, void *pbu short cl = READ_BYTE(); short frags = READ_SHORT(); short deaths = READ_SHORT(); - short playerclass = READ_SHORT(); + // short playerclass = READ_SHORT(); short teamnumber = READ_SHORT(); if( cl > 0 && cl <= MAX_PLAYERS ) { g_PlayerExtraInfo[cl].frags = frags; g_PlayerExtraInfo[cl].deaths = deaths; - g_PlayerExtraInfo[cl].playerclass = playerclass; + // g_PlayerExtraInfo[cl].playerclass = playerclass; g_PlayerExtraInfo[cl].teamnumber = teamnumber; //gViewPort->UpdateOnPlayerInfo(); diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index 0e393997..ea73cdda 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -501,7 +501,6 @@ void CHalfLifeMultiplay::InitHUD( CBasePlayer *pl ) WRITE_SHORT( 0 ); WRITE_SHORT( 0 ); WRITE_SHORT( 0 ); - WRITE_SHORT( 0 ); MESSAGE_END(); SendMOTDToClient( pl->edict() ); @@ -518,7 +517,6 @@ void CHalfLifeMultiplay::InitHUD( CBasePlayer *pl ) WRITE_BYTE( i ); // client number WRITE_SHORT( (int)plr->pev->frags ); WRITE_SHORT( plr->m_iDeaths ); - WRITE_SHORT( 0 ); WRITE_SHORT( GetTeamIndex( plr->m_szTeamName ) + 1 ); MESSAGE_END(); } @@ -746,7 +744,6 @@ void CHalfLifeMultiplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, WRITE_BYTE( ENTINDEX(pVictim->edict()) ); WRITE_SHORT( (int)pVictim->pev->frags ); WRITE_SHORT( pVictim->m_iDeaths ); - WRITE_SHORT( 0 ); WRITE_SHORT( GetTeamIndex( pVictim->m_szTeamName ) + 1 ); MESSAGE_END(); @@ -760,7 +757,6 @@ void CHalfLifeMultiplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, WRITE_BYTE( ENTINDEX( PK->edict() ) ); WRITE_SHORT( (int)PK->pev->frags ); WRITE_SHORT( PK->m_iDeaths ); - WRITE_SHORT( 0 ); WRITE_SHORT( GetTeamIndex( PK->m_szTeamName ) + 1 ); MESSAGE_END(); diff --git a/dlls/player.cpp b/dlls/player.cpp index aa2fe48d..c5f83e93 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -236,7 +236,7 @@ void LinkUserMessages( void ) gmsgInitHUD = REG_USER_MSG( "InitHUD", -1 ); // called every time a new player joins the server gmsgShowGameTitle = REG_USER_MSG( "GameTitle", 1 ); gmsgDeathMsg = REG_USER_MSG( "DeathMsg", -1 ); - gmsgScoreInfo = REG_USER_MSG( "ScoreInfo", 9 ); + gmsgScoreInfo = REG_USER_MSG( "ScoreInfo", 7 ); gmsgTeamInfo = REG_USER_MSG( "TeamInfo", -1 ); // sets the name of a player's team gmsgTeamScore = REG_USER_MSG( "TeamScore", -1 ); // sets the score of a team on the scoreboard gmsgGameMode = REG_USER_MSG( "GameMode", 1 ); @@ -1406,7 +1406,6 @@ void CBasePlayer::AddPoints( int score, BOOL bAllowNegativeScore ) WRITE_BYTE( ENTINDEX( edict() ) ); WRITE_SHORT( (int)pev->frags ); WRITE_SHORT( m_iDeaths ); - WRITE_SHORT( 0 ); WRITE_SHORT( g_pGameRules->GetTeamIndex( m_szTeamName ) + 1 ); MESSAGE_END(); } diff --git a/dlls/teamplay_gamerules.cpp b/dlls/teamplay_gamerules.cpp index 6fcdc620..b8fed438 100644 --- a/dlls/teamplay_gamerules.cpp +++ b/dlls/teamplay_gamerules.cpp @@ -313,7 +313,6 @@ void CHalfLifeTeamplay::ChangePlayerTeam( CBasePlayer *pPlayer, const char *pTea WRITE_BYTE( clientIndex ); WRITE_SHORT( (int)pPlayer->pev->frags ); WRITE_SHORT( pPlayer->m_iDeaths ); - WRITE_SHORT( 0 ); WRITE_SHORT( g_pGameRules->GetTeamIndex( pPlayer->m_szTeamName ) + 1 ); MESSAGE_END(); }