bugfix(contain): Restore retail compatibility after changes to Object::m_containedByID#2868
Open
Caball009 wants to merge 4 commits into
Open
bugfix(contain): Restore retail compatibility after changes to Object::m_containedByID#2868Caball009 wants to merge 4 commits into
Caball009 wants to merge 4 commits into
Conversation
|
| Filename | Overview |
|---|---|
| GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h | Declares containment setters used by the updated Helix flow. |
| GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/HelixContain.cpp | Synchronizes portable Helix containment IDs during insertion and removal. |
| GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp | Keeps containment pointer bookkeeping and retail-compatible serialization behavior aligned. |
Reviews (8): Last reviewed commit: "Tweaked older TSH comment." | Re-trigger Greptile
355935e to
7dfc59f
Compare
7dfc59f to
fc1d119
Compare
xezon
reviewed
Jul 13, 2026
| void onRemovedFrom( Object *removedFrom ); | ||
| Int getTransportSlotCount() const; | ||
| void friend_setContainedBy( Object *containedBy ) { m_containedBy = containedBy; } | ||
| void friend_setContainedBy( Object *containedBy, UnsignedInt frame ) { m_containedBy = containedBy; m_containedByFrame = frame; } |
There was a problem hiding this comment.
This looks like it could change CRC, no?
Author
There was a problem hiding this comment.
Yes, I've made some changes so I'm hopefully not introducing changes to the logic without a retail compatibility macro.
Author
There was a problem hiding this comment.
I definitely need to run it against more replays, though.
| void onRemovedFrom( Object *removedFrom ); | ||
| Int getTransportSlotCount() const; | ||
| void friend_setContainedBy( Object *containedBy ) { m_containedBy = containedBy; } | ||
| void friend_setContainedBy( Object *containedBy, UnsignedInt frame ) { m_containedBy = containedBy; m_containedByFrame = frame; } |
There was a problem hiding this comment.
Maybe do
void friend_setContainedBy( Object *containedBy )
{
m_containedBy = containedBy;
m_containedByFrame = m_containedBy ? TheGameLogic->getFrame() : 0;
}This way the caller cannot set a wrong frame
2 tasks
fc1d119 to
ffc3f76
Compare
321c3d5 to
bba092c
Compare
bba092c to
5da1074
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #2747 forgot to set the
containedByIDvariable for objects that make use of the helix container code. This causes a mismatch in the following 5 replays: replays.zipThis PR adds the same code that was added to
Object::onContainedBytoHelixContain::addToContainandHelixContain::addToContainListto 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: