8000 bugfix(battleplanupdate): Prevent using the Bombardment Cannon while switching Battle Plans by Stubbjax · Pull Request #2324 · TheSuperHackers/GeneralsGameCode · GitHub
[go: up one dir, main page]

Skip to content

bugfix(battleplanupdate): Prevent using the Bombardment Cannon while switching Battle Plans#2324

Merged
xezon merged 1 commit intoTheSuperHackers:mainfrom
Stubbjax:fix-bombardment-cannon-usage
Feb 19, 2026
Merged

bugfix(battleplanupdate): Prevent using the Bombardment Cannon while switching Battle Plans#2324
xezon merged 1 commit intoTheSuperHackers:mainfrom
Stubbjax:fix-bombardment-cannon-usage

Conversation

@Stubbjax
Copy link

This change fixes an issue where the Strategy Center's bombardment cannon can be manually fired while switching to another battle plan, blocking the switch in the process. The turret is now disabled as soon as it is time to pack up, rather than after the turret has finished centring.

@Stubbjax Stubbjax self-assigned this Feb 19, 2026
@Stubbjax Stubbjax added Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker USA Affects USA faction Gen Relates to Generals ZH Relates to Zero Hour NoRetail This fix or change is not applicable with Retail game compatibility labels Feb 19, 2026
@greptile-apps
Copy link
greptile-apps bot commented Feb 19, 2026

Greptile Summary

This PR fixes a bug where the Strategy Center's bombardment cannon could be manually fired while switching to another battle plan. The fix disables the turret immediately when the plan switch is initiated and the turret needs to recenter, rather than waiting until after the turret has finished centering.

Changes:

  • Added enableTurret(false) call in the !m_centeringTurret branch (line 375-376 in both files)
  • Change is wrapped in #if !RETAIL_COMPATIBLE_CRC to preserve retail behavior compatibility
  • Applies to both Generals and Zero Hour versions

How it works:
Previously, when switching away from bombardment mode, the turret would only be disabled after it reached its natural centered position (line 367). This left a window where players could manually fire the cannon during the recentering process, which would block the battle plan switch. Now, enableTurret(false) is called immediately when the recentering process begins, preventing any manual firing during the transition.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix is a simple, targeted change that addresses a specific timing issue. It mirrors the existing pattern where enableTurret(false) is already called at line 367 when the turret is centered. The change is wrapped in a retail compatibility flag, preserving original behavior when needed. The logic is sound: disabling the turret when recentering begins prevents the race condition where manual firing could interrupt the battle plan switch.
  • No files require special attention

Important Files Changed

Filename Overview
Generals/Code/GameEngine/Source/GameLogic/Object/Update/BattlePlanUpdate.cpp Added enableTurret(false) call before recentering to prevent manual firing during battle plan switch
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/BattlePlanUpdate.cpp Added enableTurret(false) call before recentering to prevent manual firing during battle plan switch

Last reviewed commit: 500576c

Copy link
@tintinhamans tintinhamans left a comment

Choose a reason for hiding this comment

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

Looks simple enough

@bobtista
Copy link

This preserves the animation too, smart find disabling the turret immediately when centering starts :) Looks good

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.

Looking good

@xezon xezon changed the title bugfix: Prevent using the bombardment cannon while switching battle plans bugfix(battleplanupdate): Prevent using the Bombardment Cannon while switching Battle Plans Feb 19, 2026
@xezon xezon merged commit d778bf3 into TheSuperHackers:main Feb 19, 2026
25 checks passed
@Stubbjax Stubbjax deleted the fix-bombardment-cannon-usage branch February 19, 2026 23:48
CookieLandProjects pushed a commit to CookieLandProjects/CLP_AI that referenced this pull request Feb 28, 2026
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 USA Affects USA faction ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

0