# HG changeset patch # User Adam Kaminski # Date 1626742080 14400 # Mon Jul 19 20:48:00 2021 -0400 # Node ID 8827b6b803531a09bf181049dc9b9541b1d0587c # Parent 66d552f9c914713b9412cf3f6586d1094c98d18b Don't print how many allies are left (or if they're all dead) on the bottom of the screen if the player never had any to begin with. diff -r 66d552f9c914 -r 8827b6b80353 src/g_shared/st_hud.cpp --- a/src/g_shared/st_hud.cpp Mon Jul 19 20:41:25 2021 -0400 +++ b/src/g_shared/st_hud.cpp Mon Jul 19 20:48:00 2021 -0400 @@ -85,6 +85,9 @@ // Is this player tied with another? static bool g_bIsTied = false; +// [AK] Does this player's team have other players besides themselves? +static bool g_bHasAllies = false; + // How many opponents are left standing in LMS? static LONG g_lNumOpponentsLeft = 0; @@ -306,13 +309,18 @@ { // Survival, Survival Invasion, etc if ( GAMEMODE_GetCurrentFlags( ) & GMF_COOPERATIVE ) + { + g_bHasAllies = g_ulNumPlayers > 1; g_lNumAlliesLeft = GAME_CountLivingAndRespawnablePlayers( ) - PLAYER_IsAliveOrCanRespawn( player ); + } // Last Man Standing, TLMS, etc if ( GAMEMODE_GetCurrentFlags( ) & GMF_DEATHMATCH ) { if ( GAMEMODE_GetCurrentFlags( ) & GMF_PLAYERSONTEAMS ) { + g_bHasAllies = TEAM_CountPlayers( player->Team ) > 1; + unsigned livingAndRespawnableTeammates = TEAM_CountLivingAndRespawnablePlayers( player->Team ); g_lNumOpponentsLeft = GAME_CountLivingAndRespawnablePlayers( ) - livingAndRespawnableTeammates; g_lNumAlliesLeft = livingAndRespawnableTeammates - PLAYER_IsAliveOrCanRespawn( player ); @@ -473,7 +481,8 @@ bottomString += " - "; // Survival, Survival Invasion, etc - if ( GAMEMODE_GetCurrentFlags( ) & GMF_COOPERATIVE ) + // [AK] Only print how many allies are left if we had any to begin with. + if (( GAMEMODE_GetCurrentFlags( ) & GMF_COOPERATIVE ) && ( g_bHasAllies )) { if ( g_lNumAlliesLeft < 1 ) { @@ -486,12 +495,13 @@ } } // Last Man Standing, TLMS, etc - else + else if (( GAMEMODE_GetCurrentFlags( ) & GMF_COOPERATIVE ) == false ) { bottomString.AppendFormat( TEXTCOLOR_GRAY "%d ", static_cast( g_lNumOpponentsLeft )); bottomString.AppendFormat( TEXTCOLOR_RED "opponent%s", g_lNumOpponentsLeft != 1 ? "s" : "" ); - if ( GAMEMODE_GetCurrentFlags( ) & GMF_PLAYERSONTEAMS ) + // [AK] Only print how many teammates are left if we actually have any. + if (( GAMEMODE_GetCurrentFlags( ) & GMF_PLAYERSONTEAMS ) && ( g_bHasAllies )) { if ( g_lNumAlliesLeft < 1 ) {