# HG changeset patch # User Adam Kaminski # Date 1625741843 14400 # Thu Jul 08 06:57:23 2021 -0400 # Node ID 3fc442998a25ff2529a3ceb0ed2fa27e8f4c5303 # Parent 15166e638fba7841f3989cbb93767baa2c5e9b95 Removed DUEL_CountActiveDuelers and replaced it with GAME_CountActivePlayers. diff -r 15166e638fba -r 3fc442998a25 src/duel.cpp --- a/src/duel.cpp Tue Jul 06 08:43:51 2021 -0400 +++ b/src/duel.cpp Thu Jul 08 06:57:23 2021 -0400 @@ -109,7 +109,7 @@ } // Two players are here now, begin the countdown! - if ( DUEL_CountActiveDuelers( ) == 2 ) + if ( GAME_CountActivePlayers( ) == 2 ) { // [BB] Skip countdown and map reset if the map is supposed to be a lobby. if ( GAMEMODE_IsLobbyMap( ) ) @@ -148,23 +148,6 @@ //***************************************************************************** // -ULONG DUEL_CountActiveDuelers( void ) -{ - ULONG ulIdx; - ULONG ulDuelers; - - ulDuelers = 0; - for ( ulIdx = 0; ulIdx < MAXPLAYERS; ulIdx++ ) - { - if (( playeringame[ulIdx] ) && ( players[ulIdx].bSpectating == false )) - ulDuelers++; - } - - return ( ulDuelers ); -} - -//***************************************************************************** -// void DUEL_StartCountdown( ULONG ulTicks ) { ULONG ulIdx; diff -r 15166e638fba -r 3fc442998a25 src/duel.h --- a/src/duel.h Tue Jul 06 08:43:51 2021 -0400 +++ b/src/duel.h Thu Jul 08 06:57:23 2021 -0400 @@ -71,7 +71,6 @@ void DUEL_Construct( void ); void DUEL_Tick( void ); -ULONG DUEL_CountActiveDuelers( void ); void DUEL_StartCountdown( ULONG ulTicks ); void DUEL_DoFight( void ); void DUEL_DoWinSequence( ULONG ulPlayer ); diff -r 15166e638fba -r 3fc442998a25 src/gamemode.cpp --- a/src/gamemode.cpp Tue Jul 06 08:43:51 2021 -0400 +++ b/src/gamemode.cpp Thu Jul 08 06:57:23 2021 -0400 @@ -793,7 +793,7 @@ return true; // [BB] Duel in progress. - if ( duel && ( DUEL_CountActiveDuelers( ) >= 2 ) ) + if ( duel && ( GAME_CountActivePlayers( ) >= 2 ) ) return true; // [BB] If lives are limited, players are not allowed to join most of the time. diff -r 15166e638fba -r 3fc442998a25 src/joinqueue.cpp --- a/src/joinqueue.cpp Tue Jul 06 08:43:51 2021 -0400 +++ b/src/joinqueue.cpp Thu Jul 08 06:57:23 2021 -0400 @@ -158,7 +158,7 @@ // If we're in a duel, revert to the "waiting for players" state. // [BB] But only do so if there are less then two duelers left (probably JOINQUEUE_PlayerLeftGame was called mistakenly). - if ( duel && ( DUEL_CountActiveDuelers( ) < 2 ) ) + if ( duel && ( GAME_CountActivePlayers( ) < 2 ) ) DUEL_SetState( DS_WAITINGFORPLAYERS ); // If only one (or zero) person is left, go back to "waiting for players". diff -r 15166e638fba -r 3fc442998a25 src/scoreboard.cpp --- a/src/scoreboard.cpp Tue Jul 06 08:43:51 2021 -0400 +++ b/src/scoreboard.cpp Thu Jul 08 06:57:23 2021 -0400 @@ -75,6 +75,7 @@ #include "st_hud.h" #include "wi_stuff.h" #include "c_console.h" +#include "g_game.h" //***************************************************************************** // VARIABLES @@ -662,7 +663,7 @@ if ( ulWinner == MAXPLAYERS ) { - if ( DUEL_CountActiveDuelers( ) == 2 ) + if ( GAME_CountActivePlayers( ) == 2 ) text = "First match between the two"; else bDraw = false;