This is a fork of Zandronum used on servers hosted by The Sentinels Playground (TSPG).
Revision | 401e3f8c6d8595e25da21a7cdc54394d0913fb3d (tree) |
---|---|
Time | 2021-07-20 10:34:40 |
Author | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Added the function HUD_GetNumSpectators.
@@ -76,6 +76,9 @@ | ||
76 | 76 | // How many players are currently in the game? |
77 | 77 | static ULONG g_ulNumPlayers = 0; |
78 | 78 | |
79 | +// [AK] How many true spectators are currently in the game? | |
80 | +static ULONG g_ulNumSpectators = 0; | |
81 | + | |
79 | 82 | // What is our current rank? |
80 | 83 | static ULONG g_ulRank = 0; |
81 | 84 |
@@ -300,6 +303,7 @@ | ||
300 | 303 | |
301 | 304 | // [AK] Count how many players are in the game. |
302 | 305 | g_ulNumPlayers = SERVER_CalcNumNonSpectatingPlayers( MAXPLAYERS ); |
306 | + g_ulNumSpectators = SERVER_CountPlayers( true ) - g_ulNumPlayers; | |
303 | 307 | |
304 | 308 | // "x opponents left", "x allies alive", etc |
305 | 309 | if ( GAMEMODE_GetCurrentFlags( ) & GMF_DEADSPECTATORS ) |
@@ -983,6 +987,13 @@ | ||
983 | 987 | |
984 | 988 | //***************************************************************************** |
985 | 989 | // |
990 | +ULONG HUD_GetNumSpectators( void ) | |
991 | +{ | |
992 | + return ( g_ulNumSpectators ); | |
993 | +} | |
994 | + | |
995 | +//***************************************************************************** | |
996 | +// | |
986 | 997 | ULONG HUD_GetRank( void ) |
987 | 998 | { |
988 | 999 | return ( g_ulRank ); |
@@ -81,6 +81,7 @@ | ||
81 | 81 | bool HUD_IsTied( void ); |
82 | 82 | ULONG HUD_GetViewPlayer( void ); |
83 | 83 | ULONG HUD_GetNumPlayers( void ); |
84 | +ULONG HUD_GetNumSpectators( void ); | |
84 | 85 | ULONG HUD_GetRank( void ); |
85 | 86 | LONG HUD_GetSpread( void ); |
86 | 87 | FString HUD_SpellOrdinal( int ranknum, bool bColored = false ); |