Skip to content

Conversation

@Mauller
Copy link

@Mauller Mauller commented Jul 19, 2025

This PR fixes various tunnel system related crashes involving the neutral player.

The initial issue was brought up by the replay attached to the associated issue. A players sneak attack tunnel was instantly subdued by a microwave tank, preventing it from fully deploying. This resulted in a crash when the player surrendered.
The tunnel became neutral and the damage being caused by the surrender attempted to retrieve the tunnel system on the neutral player.

The issue is that the neutral player does not have an associated tunnel system.

Other crashes with neutral player tunnels can also occur within kill all contained and other various contain related functions. So i added checks within all of these functions.

A few functions already checked for the presence of a valid player and valid tunnel system on that player, so it seems that it has been an issue in the past for the EA developers.

I also added overrides for some of the functions which were originally being called from the opencontain parent, this was to make it easier to implement the required functionality without adding extra null checks within opencontain.

This Fixes:

  • Crash due to the original issue of subdued tunnel deploying and player surrendering
  • Crash due to scripts trying to put something into a neutral tunnel
  • Crash due to scripts trying to check tunnel contents
  • Crash due to neutron shells hitting neutral tunnel
  • Crash due to bunker buster hitting neutral tunnel
  • Crash due to microwave tanks trying to subdue a neutral tunnel
  • Crash due to forcing units to exit a neutral tunnel

@Mauller Mauller self-assigned this Jul 19, 2025
@Mauller Mauller added Major Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour Crash This is a crash, very bad labels Jul 19, 2025
@Mauller Mauller force-pushed the fix-tunnel-contain branch from ecd478d to 3e24e57 Compare July 19, 2025 17:15
@Mauller
Copy link
Author

Mauller commented Jul 19, 2025

Small change, i initially missed that orderAllPassengersToExit was different in generals compared to zero hour

@Mauller Mauller added this to the Major bug fixes milestone Jul 19, 2025
@xezon
Copy link

xezon commented Jul 21, 2025

I remember I also added these null checks a while ago on tunnel crash but then scrapped them when I found the error higher up. In this case, error cannot be fixed higher up?

@Mauller
Copy link
Author

Mauller commented Jul 21, 2025

In this instance the problem is the neutral player again. And just using normal actions within the game, like those mentioned in the list of crashes this prevents.

The way to properly fix this is to give the neutral player a tunnel system, but its part of the xfercrc so would mismatch the game. Same problems with the player template and other neutral player related issues.

Theres nothing really higher up that can catch the missing tunnel system. And it shouldn't be handled higher up since tunnel systems aren't used beyond tunnel contain.

@Mauller Mauller force-pushed the fix-tunnel-contain branch from 3e24e57 to 56466c7 Compare July 21, 2025 18:43
@Mauller
Copy link
Author

Mauller commented Jul 21, 2025

Cleaned it up and refactored it a little based on comments

@Mauller Mauller force-pushed the fix-tunnel-contain branch from 56466c7 to 9f6ba25 Compare July 21, 2025 18:47
@Mauller
Copy link
Author

Mauller commented Jul 21, 2025

last push was jsut some small formatting tweaks

Copy link

Choose a reason for hiding this comment

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

How about we simply call the OpenContain::orderAllPassengersToExit here?

After the null check above.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah that can work, it means the implementation is still left within the open contain variant, we just have a few extra function calls in the end but it should not be a lot of extra overhead.

Copy link
Author

Choose a reason for hiding this comment

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

Tweaked all the overridden function to call their base opencontain variant instead of reimplementing the internal logic.

@Mauller Mauller force-pushed the fix-tunnel-contain branch from 9f6ba25 to 81b3f68 Compare July 22, 2025 19:23
@Mauller
Copy link
Author

Mauller commented Jul 22, 2025

Tweaked and rebased with recent main.

Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

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

Looks very good.

@xezon xezon merged commit 09ca272 into TheSuperHackers:main Jul 22, 2025
14 checks passed
@xezon xezon deleted the fix-tunnel-contain branch July 22, 2025 19:44
fbraz3 pushed a commit to fbraz3/GeneralsX that referenced this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Crash This is a crash, very bad Gen Relates to Generals Major Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The game crashes when a GLA players surprise attack tunnel gets subdued while deploying and the player surrenders while it is still subdued

4 participants