Skip to content

Special-power buttons stay disabled on newly built buildings without a SpecialPowerCreate module when RETAIL_COMPATIBLE_CRC=0 #2780

@bobtista

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

When building a USA Strategy Center in a build configured with RETAIL_COMPATIBLE_CRC=0, the special-power command buttons are permanently disabled. They don't highlight on hover and can't be clicked. Other buttons (e.g. upgrades like Advanced Training) work normally.

Cause:

SpecialPowerModule::m_availableOnFrame was changed in #1218 to initialize to 0xFFFFFFFF ("never ready") instead of 0 under !RETAIL_COMPATIBLE_CRC. A building constructed by the player is created with OBJECT_STATUS_UNDER_CONSTRUCTION, so the SpecialPowerModule constructor skips startPowerRecharge(). The recharge is expected to happen at build completion via a SpecialPowerCreate module - but buildings that don't have that module (eg Strategy Center) never charged, so m_availableOnFrame stays at the 0xFFFFFFFF sentinel and isReady() is permanently false. Under retail (m_availableOnFrame = 0) these powers were ready by default, which is why the regression only appears with RETAIL_COMPATIBLE_CRC=0.

Reproduction Steps

Run a game with retail compatibility off, build a strategy center, try to click Search and Destroy or use Intelligence.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is not working right, typically is user facing⚠️ TriageIssues requiring initial review and prioritization

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions