Skip to content

Conversation

@Stubbjax
Copy link

This change fixes an issue where subdual damage (dealt by the ECM Tank and Microwave Tank in retail) can continuously negatively stack if the target's heal rate is faster than the subdual weapon's damage rate.

image

There are no cases where this happens in the retail game, but it is still a logical flaw that can be encountered through modding or custom maps.

For example:

  • A target has a SubdualDamageHealRate of 100 and SubdualDamageHealAmount of 200
  • A subdual weapon has a DelayBetweenShots of 200 and PrimaryDamage of 100
Frame 01: Subdual weapon deals 100 subdual damage, target subdual damage is now 100
Frame 02: ...
Frame 03: ...
Frame 04: ...
Frame 05: Target heals 200 subdual damage, target subdual damage is now -100
Frame 06: ...
Frame 07: ...
Frame 08: ...
Frame 09: Subdual weapon deals 100 subdual damage, target subdual damage is now 0
Frame 10: ...
Frame 11: ...
Frame 12: ...
Frame 13: Target heals 200 subdual damage, subdual damage is now -200
Frame 14: ...
Frame 15: ...
Frame 16: ...
Frame 17: Subdual weapon deals 100 subdual damage, target subdual damage is now -100
Frame 18: ...
Frame 19: ...
Frame 20: ...
Frame 21: Target heals 200 subdual damage, subdual damage is now -300
...

@Stubbjax Stubbjax self-assigned this Jan 25, 2026
@Stubbjax Stubbjax added Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour Fix Is fixing something, but is not user facing Mod Relates to Mods or modding NoRetail This fix or change is not applicable with Retail game compatibility labels Jan 25, 2026
// stops weak subdual damage + rapid healing from building up a subdual damage buffer over time.
#if !RETAIL_COMPATIBLE_CRC
if (m_currentSubdualDamage < 0)
m_currentSubdualDamage = 0;
Copy link

Choose a reason for hiding this comment

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

Perhaps write as

#if RETAIL_COMPATIBLE_CRC
  m_currentSubdualDamage = min(m_currentSubdualDamage, data->m_subdualDamageCap);
#else
	// TheSuperHackers @bugfix Stubbjax 25/01/2026 Subdual damage can no longer go negative. This
	// stops weak subdual damage + rapid healing from building up a subdual damage buffer over time.
  m_currentSubdualDamage = clamp(0, m_currentSubdualDamage, data->m_subdualDamageCap);
#endif

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

Labels

Fix Is fixing something, but is not user facing Minor Severity: Minor < Major < Critical < Blocker Mod Relates to Mods or modding 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