# HG changeset patch # User Adam Kaminski # Date 1608163001 18000 # Wed Dec 16 18:56:41 2020 -0500 # Node ID 275168a48151b81e950236a517dc85091267d614 # Parent 0763e476a46f35d819d574fd34ff434b1ae1e90d Added missing checks to "messagemode" and "messagemode2", preventing them from being executed during demo playback or by using ConsoleCommand. diff -r 0763e476a46f -r 275168a48151 src/chat.cpp --- a/src/chat.cpp Fri Dec 04 19:48:07 2020 -0500 +++ b/src/chat.cpp Wed Dec 16 18:56:41 2020 -0500 @@ -1502,6 +1502,17 @@ // [TP] CCMD( messagemode ) { + // [AK] Mods are not allowed to say anything in the player's name. + if ( ACS_IsCalledFromConsoleCommand( )) + return; + + // [AK] No chatting while playing a demo. + if ( CLIENTDEMO_IsPlaying( ) == true ) + { + Printf ( "You can't chat during demo playback.\n" ); + return; + } + if ( NETWORK_GetState() != NETSTATE_SERVER ) { chat_SetChatMode( CHATMODE_GLOBAL ); @@ -1513,6 +1524,17 @@ // [TP] CCMD( messagemode2 ) { + // [AK] Mods are not allowed to say anything in the player's name. + if ( ACS_IsCalledFromConsoleCommand( )) + return; + + // [AK] No chatting while playing a demo. + if ( CLIENTDEMO_IsPlaying( ) == true ) + { + Printf ( "You can't chat during demo playback.\n" ); + return; + } + if ( NETWORK_GetState() != NETSTATE_SERVER ) { chat_SetChatMode( CHATMODE_TEAM );