Skip to content

bugfix(contain): Restore retail compatibility after changes to Object::m_containedByID#2868

Merged
xezon merged 6 commits into
TheSuperHackers:mainfrom
Caball009:restore_retail_comp_helixcontain
Jul 24, 2026
Merged

bugfix(contain): Restore retail compatibility after changes to Object::m_containedByID#2868
xezon merged 6 commits into
TheSuperHackers:mainfrom
Caball009:restore_retail_comp_helixcontain

Conversation

@Caball009

@Caball009 Caball009 commented Jul 12, 2026

Copy link
Copy Markdown

PR #2747 forgot to set the containedByID variable for objects that make use of the helix container code. This causes a mismatch for the following 5 replays: replays.zip

This PR adds the same code that was added to Object::onContainedBy to HelixContain::addToContain and HelixContain::addToContainList to fix the issue.

Resetting the contain variables, as is done in the third commit, is not needed to restore retail compatibility. I added that code because I think it's correct to reset the contain variables when the object is removed from its container.

TODO:

  • Replicate in Generals.
  • Test against replays again.

@Caball009 Caball009 added Bug Something is not working right, typically is user facing Major Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour ThisProject The issue was introduced by this project, or this task is specific to this project labels Jul 12, 2026
@Caball009
Caball009 marked this pull request as ready for review July 12, 2026 20:26
@greptile-apps

greptile-apps Bot commented Jul 12, 2026

Copy link
Copy Markdown

Greptile Summary

This PR restores retail-compatible Helix containment state handling. The main changes are:

  • Adds explicit containment-ID updates for Helix portable structures.
  • Clears the serialized containment ID when a portable is removed.
  • Moves the containment-pointer setter out of the object headers.
  • Mirrors the object-side compatibility changes in Generals.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/HelixContain.cpp Updates Helix portable add and removal paths to maintain the retail-compatible containment ID.
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp Moves containment-pointer updates into an out-of-line setter and preserves explicitly maintained IDs during transfer.
GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h Declares the containment setters used by specialized contain modules.
Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp Mirrors the object containment setter and transfer behavior for Generals.
Generals/Code/GameEngine/Include/GameLogic/Object.h Mirrors the containment setter declarations for Generals.

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

Comment thread GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/HelixContain.cpp Outdated
@Caball009
Caball009 force-pushed the restore_retail_comp_helixcontain branch 2 times, most recently from 7dfc59f to fc1d119 Compare July 12, 2026 21:21
@Caball009
Caball009 marked this pull request as draft July 12, 2026 21:23
@Caball009
Caball009 marked this pull request as ready for review July 12, 2026 23:47
Comment thread GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h Outdated
Comment thread GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h Outdated
@Caball009
Caball009 force-pushed the restore_retail_comp_helixcontain branch 3 times, most recently from bba092c to 5da1074 Compare July 13, 2026 22:04

@xezon xezon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs replicate in Generals

@Caball009
Caball009 force-pushed the restore_retail_comp_helixcontain branch from 5da1074 to 5bd8731 Compare July 24, 2026 10:24
@Caball009

Caball009 commented Jul 24, 2026

Copy link
Copy Markdown
Author

Rebased, and replicated in Generals with two notes:

  1. Object::friend_setContainedByID is behind the RTS_ZEROHOUR macro.
  2. The changes to HelixContain.cpp are Zero Hour only because Generals doesn't have this file.

@xezon
xezon merged commit a20992d into TheSuperHackers:main Jul 24, 2026
17 checks passed
@Caball009
Caball009 deleted the restore_retail_comp_helixcontain branch July 24, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something is not working right, typically is user facing Major Severity: Minor < Major < Critical < Blocker ThisProject The issue was introduced by this project, or this task is specific to this project ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants