Skip to content

bugfix(saveload): Fix aircraft carrier losing its order when saving#2996

Open
bobtista wants to merge 3 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/carrier-loses-target-on-save
Open

bugfix(saveload): Fix aircraft carrier losing its order when saving#2996
bobtista wants to merge 3 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/carrier-loses-target-on-save

Conversation

@bobtista

@bobtista bobtista commented Jul 21, 2026

Copy link
Copy Markdown

FlightDeckBehavior::xfer reads its designated command into an uninitialized local and then assigns it back to m_designatedCommand on both save and load. On save xferInt only writes the local out to the file, so the uninitialized stack value is written to the save and copied back over the live command. From then on hasTakeoffOrders() falls through to its default case and the carrier stops launching, so the planes already in the air finish their attack and no new ones take off.

Now the local is seeded from m_designatedCommand before the xfer, so saving writes the real order and the copy-back is a no-op. This does not change the save layout, so existing saves still load.

Todo:

  • Verify in USA 02: force fire terrain, save without loading, confirm the carrier keeps launching planes
  • Replicate to Generals — N/A, FlightDeckBehavior (Aircraft Carrier) is Zero Hour only

@bobtista bobtista self-assigned this Jul 21, 2026
@bobtista bobtista added the Bug Something is not working right, typically is user facing label Jul 21, 2026
@greptile-apps

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes carrier orders being lost during save/load serialization.

  • Seeds the serialized command value from the live flight deck command.
  • Keeps the existing save layout unchanged.
  • Preserves the command value during save and checksum-style xfer passes.

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/Behavior/FlightDeckBehavior.cpp Initializes the temporary command value before xfer so save paths serialize the current flight deck order.

Reviews (3): Last reviewed commit: "docs(savegame): Remove carrier command t..." | Re-trigger Greptile

@Caball009 Caball009 added Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour Saveload Is Saveload/Xfer related labels Jul 21, 2026
@xezon xezon changed the title bugfix(savegame): Fix aircraft carrier losing its order when saving bugfix(saveload): Fix aircraft carrier losing its order when saving Jul 24, 2026

@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.

Fix correct

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 Minor Severity: Minor < Major < Critical < Blocker Saveload Is Saveload/Xfer related ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Aircraft Carrier stops attacking after saving the game

3 participants