Skip to content

Conversation

@bobtista
Copy link

@bobtista bobtista commented Oct 31, 2025

Addresses issue #1700

Tested by building a power plant, then a gatling cannon, force firing it, then selling the power plant and trying to force fire.

Result: The gatling cannon can no longer force fire while powered down, the "can't" mouse cursor is displayed, and there is no spinning animation.

return false;

// TheSuperHackers @bugfix bobtista 31/10/2025 Fixes Gatling Cannon barrels rotating despite insufficient energy. (#1700)
if ( isKindOf( KINDOF_POWERED ) && isDisabledByType( DISABLED_UNDERPOWERED ) )

Choose a reason for hiding this comment

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

So previously, patriot and strat centre would also show attack mouse marker rather than disabled mouse marker?

Copy link
Author

Choose a reason for hiding this comment

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

Yes - in retail, Patriots (and any other KINDOF_POWERED structures) would also show the attack mouse marker rather than the disabled mouse marker when underpowered.
However, the Strategy center cannon is not a powered thing, it can still force fire like a fire base without power.
I've tested these with this fix - while undepowered, the patriot and gatling cannon now correctly show the disabled mouse cursor, and the strategy center can still force fire its cannon.

@bobtista bobtista force-pushed the bobtista/fix-gatling-barrel-animation-no-power branch from 66be9c0 to b2278a6 Compare November 5, 2025 15:17
@Mauller
Copy link

Mauller commented Nov 9, 2025

This wants testing for retail compatibility

@Skyaero42
Copy link

This wants testing for retail compatibility

This one’s tricky. I ran a comparison test:

  • Played a vanilla game where I force-fired the Gatling.
  • Then ran that replay on this PR build
  • (and vice versa — though force-fire doesn’t work here, so that test isn’t very meaningful).

When playing in vanilla and replaying in this PR, the barrels still move when the force-attack command was given. That suggests the barrel rotation state is recorded in the replay. However, there is no mismatch, so maybe it is not transferred in the xfer.

To stay safe, I’d recommend putting this change behind CRC guards.

Also, there’s an edge case still present in this PR:

  • Build Power and a Gatling.
  • Force-fire the Gatling.
  • Sell the Power.
    → Once power is gone, the Gatling stops spinning, but starts again after about two seconds — which shouldn’t happen.

@bobtista bobtista force-pushed the bobtista/fix-gatling-barrel-animation-no-power branch from b2278a6 to e8b36a1 Compare November 11, 2025 20:46
@bobtista
Copy link
Author

This wants testing for retail compatibility

This one’s tricky. I ran a comparison test:

  • Played a vanilla game where I force-fired the Gatling.
  • Then ran that replay on this PR build
  • (and vice versa — though force-fire doesn’t work here, so that test isn’t very meaningful).

When playing in vanilla and replaying in this PR, the barrels still move when the force-attack command was given. That suggests the barrel rotation state is recorded in the replay. However, there is no mismatch, so maybe it is not transferred in the xfer.

To stay safe, I’d recommend putting this change behind CRC guards.

Also, there’s an edge case still present in this PR:

  • Build Power and a Gatling.
  • Force-fire the Gatling.
  • Sell the Power.
    → Once power is gone, the Gatling stops spinning, but starts again after about two seconds — which shouldn’t happen.

I added another check in adjustModelConditionForWeaponStatus() that hopefully addresses the spinning animation edge case - I can't test it this week though, if someone else can try it. I put the change behind CRC guards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants