diff --git a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h index 100e6dd682a..66a9165a8f1 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h @@ -600,7 +600,7 @@ class GameMessage : public MemoryPoolObject MSG_CREATE_FORMATION, ///< Creates a formation. MSG_LOGIC_CRC, ///< CRC from the logic passed around in a network game :) MSG_SET_MINE_CLEARING_DETAIL, ///< CRC from the logic passed around in a network game :) - MSG_ENABLE_RETALIATION_MODE, ///< Turn retaliation mode on or off for the specified player. + MSG_ENABLE_RETALIATION_MODE, ///< Turn retaliation mode on or off. MSG_BEGIN_DEBUG_NETWORK_MESSAGES = 1900, ///< network messages that exist only in debug/internal builds. all grouped separately. diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp index f7a676be93b..5c4009fd423 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp @@ -707,7 +707,9 @@ void Player::update() GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_ENABLE_RETALIATION_MODE ); if( msg ) { +#if RETAIL_COMPATIBLE_CRC msg->appendIntegerArgument( getPlayerIndex() ); +#endif msg->appendBooleanArgument( TheGlobalData->m_clientRetaliationModeEnabled ); } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp index f2483a1e159..85bd86f1971 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp @@ -632,15 +632,26 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) case GameMessage::MSG_ENABLE_RETALIATION_MODE: { +#if RETAIL_COMPATIBLE_CRC //Logically turns on or off retaliation mode for a specified player. - Int playerIndex = msg->getArgument( 0 )->integer; - Bool enableRetaliation = msg->getArgument( 1 )->boolean; + const Int playerIndex = msg->getArgument( 0 )->integer; + const Bool enableRetaliation = msg->getArgument( 1 )->boolean; Player *player = ThePlayerList->getNthPlayer( playerIndex ); if( player ) { + DEBUG_ASSERTCRASH(player == thisPlayer, + ("Retaliation mode of player '%ls' was illegally set by player '%ls'. Before: '%d', after: '%d'.", + player->getPlayerDisplayName().str(), thisPlayer->getPlayerDisplayName().str(), + player->isLogicalRetaliationModeEnabled(), enableRetaliation) ); + player->setLogicalRetaliationModeEnabled( enableRetaliation ); } +#else + // TheSuperHackers @fix stephanmeesters 08/03/2026 Ensure that players can only set their own retaliation mode. + const Bool enableRetaliation = msg->getArgument( 0 )->boolean; + thisPlayer->setLogicalRetaliationModeEnabled( enableRetaliation ); +#endif break; }