• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

This is a fork of Zandronum used on servers hosted by The Sentinels Playground (TSPG).


Commit MetaInfo

Revision401e3f8c6d8595e25da21a7cdc54394d0913fb3d (tree)
Time2021-07-20 10:34:40
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Added the function HUD_GetNumSpectators.

Change Summary

Incremental Difference

diff -r 696509385c05 -r 401e3f8c6d85 src/g_shared/st_hud.cpp
--- a/src/g_shared/st_hud.cpp Mon Jul 19 21:22:27 2021 -0400
+++ b/src/g_shared/st_hud.cpp Mon Jul 19 21:34:40 2021 -0400
@@ -76,6 +76,9 @@
7676 // How many players are currently in the game?
7777 static ULONG g_ulNumPlayers = 0;
7878
79+// [AK] How many true spectators are currently in the game?
80+static ULONG g_ulNumSpectators = 0;
81+
7982 // What is our current rank?
8083 static ULONG g_ulRank = 0;
8184
@@ -300,6 +303,7 @@
300303
301304 // [AK] Count how many players are in the game.
302305 g_ulNumPlayers = SERVER_CalcNumNonSpectatingPlayers( MAXPLAYERS );
306+ g_ulNumSpectators = SERVER_CountPlayers( true ) - g_ulNumPlayers;
303307
304308 // "x opponents left", "x allies alive", etc
305309 if ( GAMEMODE_GetCurrentFlags( ) & GMF_DEADSPECTATORS )
@@ -983,6 +987,13 @@
983987
984988 //*****************************************************************************
985989 //
990+ULONG HUD_GetNumSpectators( void )
991+{
992+ return ( g_ulNumSpectators );
993+}
994+
995+//*****************************************************************************
996+//
986997 ULONG HUD_GetRank( void )
987998 {
988999 return ( g_ulRank );
diff -r 696509385c05 -r 401e3f8c6d85 src/g_shared/st_hud.h
--- a/src/g_shared/st_hud.h Mon Jul 19 21:22:27 2021 -0400
+++ b/src/g_shared/st_hud.h Mon Jul 19 21:34:40 2021 -0400
@@ -81,6 +81,7 @@
8181 bool HUD_IsTied( void );
8282 ULONG HUD_GetViewPlayer( void );
8383 ULONG HUD_GetNumPlayers( void );
84+ULONG HUD_GetNumSpectators( void );
8485 ULONG HUD_GetRank( void );
8586 LONG HUD_GetSpread( void );
8687 FString HUD_SpellOrdinal( int ranknum, bool bColored = false );