Skip to content

bugfix(behavior): Do not fire weapons via the InstantDeathBehavior module while under construction - #3002

Merged
xezon merged 1 commit into
TheSuperHackers:mainfrom
Stubbjax:prevent-instant-death-behavior-weapons-under-construction
Jul 22, 2026
Merged

bugfix(behavior): Do not fire weapons via the InstantDeathBehavior module while under construction#3002
xezon merged 1 commit into
TheSuperHackers:mainfrom
Stubbjax:prevent-instant-death-behavior-weapons-under-construction

Conversation

@Stubbjax

Copy link
Copy Markdown

This change prevents weapons from being fired via the InstantDeathBehavior module if the OBJECT_STATUS_UNDER_CONSTRUCTION status is set.

This behaviour is already inherent to the FireWeaponWhenDeadBehavior module, and behaviour is now consistent between both modules as a result.

Retail data relies on this inherent condition - note ChinaPowerPlant does not fire its death weapon when destroyed/cancelled while under construction, despite lacking an ExemptStatus = UNDER_CONSTRUCTION field:

Object ChinaPowerPlant
  Behavior = FireWeaponWhenDeadBehavior ModuleTag_XX
    DeathWeapon = ChinaPowerPlantDeathWeapon
    StartsActive = YES
  End
End

However, when utilising the InstantDeathBehavior module, this inherent condition no longer applies and the weapon is fired when destroyed/cancelled while under construction:

Object ChinaPowerPlant
  Behavior = InstantDeathBehavior ModuleTag_XX
    Weapon = ChinaPowerPlantDeathWeapon
  End
End

This deviation between behaviours is not visible nor intuitive. An alternative approach would be to remove the inherent condition entirely from both modules and rely on the data-driven ExemptStatus. However, this would break retail data and likely cause unnecessary additional work for modders; there is unlikely to ever be a situation where a scaffold should fire a weapon upon destruction/cancellation.

@Stubbjax Stubbjax self-assigned this Jul 22, 2026
@Stubbjax Stubbjax added Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels Jul 22, 2026
@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown

Greptile Summary

Prevents InstantDeathBehavior from firing configured weapons for objects marked under construction in non-retail-compatible builds.

  • Applies the same weapon-firing guard to the Generals and Zero Hour implementations.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp Adds the under-construction weapon suppression to the Generals behavior implementation.
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp Mirrors the under-construction weapon suppression in the Zero Hour behavior implementation.

Reviews (2): Last reviewed commit: "bugfix: Do not fire weapons via the Inst..." | Re-trigger Greptile

@Stubbjax
Stubbjax force-pushed the prevent-instant-death-behavior-weapons-under-construction branch from e284b39 to 906e1d5 Compare July 22, 2026 17:33
@xezon xezon changed the title bugfix: Do not fire weapons via the InstantDeathBehavior module while under construction bugfix(behavior): Do not fire weapons via the InstantDeathBehavior module while under construction Jul 22, 2026
@xezon xezon added the NoRetail This fix or change is not applicable with Retail game compatibility label Jul 22, 2026
@xezon
xezon merged commit 12f7de9 into TheSuperHackers:main Jul 22, 2026
17 checks passed
@Stubbjax
Stubbjax deleted the prevent-instant-death-behavior-weapons-under-construction branch July 28, 2026 13:52
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 ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants