Skip to content

Units queued at a dock never dock again after loading a save #3116

Description

@bobtista

Prerequisites

  • I have searched for similar issues and confirmed this is not a duplicate

Game Version

  • Command & Conquer Generals
  • Command & Conquer Generals: Zero Hour
  • Other (please specify below)

Bug Description

Loading a save where units are queued at a dock leaves the queue stuck. A unit that was already docking finishes and leaves normally, but the dock never accepts another one after that. The waiting units sit at their approach positions for the rest of the game, so supply lines stop.

Expected: after loading, the queue keeps running and units dock in turn.

Actual: the dock goes idle with units still queued at it, permanently.

Reproduction Steps

  1. Start a skirmish and build a supply center with enough workers that one is docked and at least one more is waiting behind it.
  2. Save while one worker is docked and another is waiting in the queue.
  3. Load the save.
  4. Watch the docked worker finish and leave.

Additional Context

DockUpdate::xfer copies each m_approachPositionReached entry into a local Bool and passes that to xferBool. BoolVector is std::vector<bool>, so operator[] returns a proxy rather than a reference and the loaded value is never written back into the vector. m_approachPositionOwners is restored, so the dock still holds its approach slots while every reached flag reads false. isClearToAdvance and DockUpdate::update both read those flags, and onApproachReached only fires from AIDockApproachState::onExit, which a restored unit has already passed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions