• R/O
  • SSH

zandronum-sandbox-stable: Commit


Commit MetaInfo

Revision84b6c58c6f4d94b0cc4b4d134e662698c5d2f65f (tree)
Time2022-10-01 09:06:20
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Moved the definition of the spectate CCMD from deathmatch.cpp to p_interaction.cpp.

Change Summary

Incremental Difference

diff -r 7050397ab1ea -r 84b6c58c6f4d src/deathmatch.cpp
--- a/src/deathmatch.cpp Thu Sep 29 00:43:46 2022 -0400
+++ b/src/deathmatch.cpp Fri Sep 30 20:06:20 2022 -0400
@@ -299,40 +299,6 @@
299299 }
300300
301301 //*****************************************************************************
302-//
303-CCMD( spectate )
304-{
305- // [BB] When playing a demo enter free spectate mode.
306- if ( CLIENTDEMO_IsPlaying( ) == true )
307- {
308- C_DoCommand( "demo_spectatefreely" );
309- return;
310- }
311-
312- // [BB] The server can't use this.
313- if ( NETWORK_GetState( ) == NETSTATE_SERVER )
314- {
315- Printf ( "CCMD spectate can't be used on the server\n" );
316- return;
317- }
318-
319- // If we're a client, inform the server that we wish to spectate.
320- // [BB] This also serves as way to leave the join queue.
321- if ( NETWORK_GetState( ) == NETSTATE_CLIENT )
322- {
323- CLIENTCOMMANDS_Spectate( );
324- return;
325- }
326-
327- // Already a spectator!
328- if ( PLAYER_IsTrueSpectator( &players[consoleplayer] ))
329- return;
330-
331- // Make the player a spectator.
332- PLAYER_SetSpectator( &players[consoleplayer], true, false );
333-}
334-
335-//*****************************************************************************
336302 //*****************************************************************************
337303 //
338304 CUSTOM_CVAR( Int, fraglimit, 0, CVAR_SERVERINFO | CVAR_CAMPAIGNLOCK )
diff -r 7050397ab1ea -r 84b6c58c6f4d src/p_interaction.cpp
--- a/src/p_interaction.cpp Thu Sep 29 00:43:46 2022 -0400
+++ b/src/p_interaction.cpp Fri Sep 30 20:06:20 2022 -0400
@@ -3631,6 +3631,40 @@
36313631
36323632 //*****************************************************************************
36333633 //
3634+CCMD( spectate )
3635+{
3636+ // [BB] When playing a demo enter free spectate mode.
3637+ if ( CLIENTDEMO_IsPlaying( ) == true )
3638+ {
3639+ C_DoCommand( "demo_spectatefreely" );
3640+ return;
3641+ }
3642+
3643+ // [BB] The server can't use this.
3644+ if ( NETWORK_GetState( ) == NETSTATE_SERVER )
3645+ {
3646+ Printf ( "CCMD spectate can't be used on the server\n" );
3647+ return;
3648+ }
3649+
3650+ // If we're a client, inform the server that we wish to spectate.
3651+ // [BB] This also serves as way to leave the join queue.
3652+ if ( NETWORK_GetState( ) == NETSTATE_CLIENT )
3653+ {
3654+ CLIENTCOMMANDS_Spectate( );
3655+ return;
3656+ }
3657+
3658+ // Already a spectator!
3659+ if ( PLAYER_IsTrueSpectator( &players[consoleplayer] ))
3660+ return;
3661+
3662+ // Make the player a spectator.
3663+ PLAYER_SetSpectator( &players[consoleplayer], true, false );
3664+}
3665+
3666+//*****************************************************************************
3667+//
36343668 CCMD( taunt )
36353669 {
36363670 // [BB] No taunting while playing a demo.
Show on old repository browser