-
Notifications
You must be signed in to change notification settings - Fork 173
fix(logic): Improve handling of ENABLE_RETALIATION_MODE in GameLogicDispatch #2408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c10f6de
6d9e872
1b1cd37
d4acfd6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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; | ||
Caball009 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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 ); | ||
stephanmeesters marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| #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 ); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I expect this will cause mismatch now. Retaliation needs to be network synced otherwise the Unit behavior will mismatch between clients.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did test it with local multiplayer multi-instance without issues. The only effective change is to use the knowledge that a player can only change its own retaliation mode, so there is no apparent need to pass another player ID as message argument, as you can use the ID of the owner of the message (which is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok I understand now. I was confused by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can do that in #2383 if you like. |
||
| #endif | ||
| break; | ||
| } | ||
|
|
||
Caball009 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.