Skip to content

tweak(gamemessage): Remove unused argument of MSG_DESTROY_SELECTED_GROUP#2664

Merged
xezon merged 2 commits intoTheSuperHackers:mainfrom
Caball009:tweak_msg_destroy_sel_group
Apr 30, 2026
Merged

tweak(gamemessage): Remove unused argument of MSG_DESTROY_SELECTED_GROUP#2664
xezon merged 2 commits intoTheSuperHackers:mainfrom
Caball009:tweak_msg_destroy_sel_group

Conversation

@Caball009
Copy link
Copy Markdown

@Caball009 Caball009 commented Apr 29, 2026

This PR makes a small tweak to GameMessage::MSG_DESTROY_SELECTED_GROUP. It had an unused boolean argument, but it's called many times; on every left mouse click that's not on the HUD, actually. The removal should provide a modest reduction in the number of bytes that are stored in replays or sent across the network.

TODO:

  • Replicate in Generals.

@Caball009 Caball009 added Enhancement Is new feature or request Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels Apr 29, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 29, 2026

Greptile Summary

This PR removes an unused boolean argument from GameMessage::MSG_DESTROY_SELECTED_GROUP in both the Generals and GeneralsMD codebases, and updates the corresponding header comment to better describe the message's actual behavior. All message handlers (GameLogicDispatch.cpp, CommandXlat.cpp) were verified to not consume any argument from this message, confirming the boolean was dead data.

The PR description's TODO "Replicate in Generals" appears to be a stale checkbox — the Generals changes are already included in this PR.

Confidence Score: 5/5

Safe to merge — the boolean argument was confirmed unused across all message handlers in both codebases.

All handlers for MSG_DESTROY_SELECTED_GROUP were verified to not read any argument, the change is applied symmetrically across Generals and GeneralsMD, and the updated doc comment is more accurate than the original.

No files require special attention.

Important Files Changed

Filename Overview
Generals/Code/GameEngine/Include/Common/MessageStream.h Updates the MSG_DESTROY_SELECTED_GROUP doc comment from the inaccurate (teamID) description to a clearer behavioral description.
Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp Removes the unused appendBooleanArgument(true) call and its misleading comment; adds a @tweak note explaining the rationale.
GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h Mirror of the Generals header change — same doc comment correction for MSG_DESTROY_SELECTED_GROUP.
GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp Mirror of the Generals source change — removes the dead boolean argument and adds the explanatory @tweak comment.

Sequence Diagram

sequenceDiagram
    participant UI as InGameUI
    participant MS as TheMessageStream
    participant CX as CommandXlat
    participant GLD as GameLogicDispatch

    UI->>MS: appendMessage(MSG_DESTROY_SELECTED_GROUP)
    Note over UI,MS: Before: also appended boolean true (unused)
    MS->>CX: dispatch MSG_DESTROY_SELECTED_GROUP
    CX->>CX: m_teamExists = false
    MS->>GLD: dispatch MSG_DESTROY_SELECTED_GROUP
    GLD->>GLD: setCurrentlySelectedAIGroup(nullptr)
Loading

Reviews (2): Last reviewed commit: "Replicated in Generals." | Re-trigger Greptile

Comment thread GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@Caball009
Copy link
Copy Markdown
Author

Caball009 commented Apr 30, 2026

Replicated in Generals.

FWIW, I probably have two more PRs coming up that make similar changes.

@xezon xezon changed the title tweak(msg): Remove unused argument of MSG_DESTROY_SELECTED_GROUP tweak(gamemessage): Remove unused argument of MSG_DESTROY_SELECTED_GROUP Apr 30, 2026
@xezon xezon merged commit a9b260a into TheSuperHackers:main Apr 30, 2026
32 of 33 checks passed
@Caball009 Caball009 deleted the tweak_msg_destroy_sel_group branch April 30, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Is new feature or request Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants