Skip to content

bugfix: Make Helicopter and Chinook ignore repair command when ordered to repair again at the same airfield - #3118

Draft
Caball009 wants to merge 4 commits into
TheSuperHackers:mainfrom
Caball009:fix_heli_chinook_repair
Draft

bugfix: Make Helicopter and Chinook ignore repair command when ordered to repair again at the same airfield#3118
Caball009 wants to merge 4 commits into
TheSuperHackers:mainfrom
Caball009:fix_heli_chinook_repair

Conversation

@Caball009

@Caball009 Caball009 commented Aug 12, 2026

Copy link
Copy Markdown

Helipad units (e.g. Comanches, Chinooks and Helixes) will interrupt their repair sequence even when ordered to repair at the same airfield they were already repairing at. This PR makes them ignore the repair command in that case.

See commits for cleaner diffs.


Before:

gen_zh_aircraft_repair_before.mp4

After:

gen_zh_aircraft_repair_after.mp4

TODO:

  • Verify fallthrough behavior for previous switch cases in JetAIUpdate::aiDoCommand.
  • Replicate to Generals.

@Caball009 Caball009 added Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker Unit AI Is related to unit behavior Gen Relates to Generals ZH Relates to Zero Hour NoRetail This fix or change is not applicable with Retail game compatibility labels Aug 12, 2026
}

FALLTHROUGH;
FALLTHROUGH; // else fall through to the default case!

@Caball009 Caball009 Aug 12, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@Stubbjax Was the intention here is to fall through to the default case, instead of AICMD_ENTER or AICMD_GET_REPAIRED ?

Code was added here: https://github.com/TheSuperHackers/GeneralsGameCode/pull/2174/changes

I'll to need to revert some changes if your code does what it intended to do.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The intention is that if the jet is not out of special reload ammo, then it will proceed to the default case.

@Caball009 Caball009 Aug 13, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Right. That's slightly different from how the code behaves prior to this PR, but I fixed it.

Perhaps I should use a goto, though. It'd be more robust as it'll withstand future changes to the switch statement.

@Caball009
Caball009 force-pushed the fix_heli_chinook_repair branch from 81c4c7e to 25c1a62 Compare August 13, 2026 15:07
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 Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker NoRetail This fix or change is not applicable with Retail game compatibility Unit AI Is related to unit behavior ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants