Repository navigation
bugfix: Prevent crashing Generals when attacking units from previously transferred Tunnel Network - #3341
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughIn retail-compatible Generals builds, the attack state now handles a missing containment module by removing and destroying objects in the matching tunnel containment list, then returning ChangesTunnel occupant validation
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: 🟡 Moderate · up to
|
|
Would be good to test against with a combo of TSH and retail players. The retail players should crash out and the TSH players should be able to continue. Would any additional failover help i.e. deleting the unit when the crash is detected? |
Seems to me that the replay I included already provides that information.
I'll have a look at this. |
|
Those units now get destroyed when the crash gets prevented. I've added a second replay for the new behavior. |
There'll be a few more changes after this.
5e7a2be to
f196b17
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
719389f1-e4a3-42d4-9da8-1f2d47f4c048
📥 Commits
Reviewing files that changed from the base of the PR and between 6983639f1654342b5a8f061b9496ec840ad47269 and 08fc877d782c4dda979a07599b9d027563e5adbd.
📒 Files selected for processing (3)
Generals/Code/GameEngine/Include/GameLogic/GameLogic.hGenerals/Code/GameEngine/Source/GameLogic/AI/AIStates.cppGenerals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
604995c to
62d0642
Compare
[Medium impact] The change affects two combat-related paths in retail-compatible Generals and Zero Hour. The repository's comment-date requirement must be satisfied before merging; no new blocking behavior defect was established. Findings
|
|
Needs replicate. |
cca14ea to
3289e16
Compare
|
I had to refactor a bit of Generals and Zero Hour code to prepare for the code replication to Zero Hour. #if RTS_GENERALS && RETAIL_COMPATIBLE_CRC
if( containedBy && weapon )
#else
if( containedBy && weapon && contain && contain->isEnclosingContainerFor( source ) )
#endifNon-retail compatible Generals now uses the second condition, just like Zero Hour. |
|
There is an open complaint from macroslop bot |
…y transferred Tunnel Network (TheSuperHackers#3341)
The following is retail behavior and doesn't happen with retail compatibility disabled: when a Tunnel Network with units is transferred to another player, it leaves the units in an invalid state. They disappear from the tunnel's GUI and become inaccessible to the player. If that tunnel is sold or destroyed the units remain behind hidden and indestructible. The units hold on to a pointer to the tunnel object, which may get reused for something else. In this invalid state, some units can attack enemy units. This may crash the game.
These crashes are specific to retail Generals, AFAICT due to the missing
TunnelContain::onCaptureoverload. This PR prevents two crashes because of this issue, and destroys all the units after the first crash would have happened.Custom map and VS22 replays that reproduce the two crashes for the last commit: replays.zip.
Both replays can also be used to crash generalsv-weekly-2026-10-02 despite the mismatches.
TODO: