Skip to content

Conversation

@Stubbjax
Copy link

This change prevents bunkered Battle Buses from being subdued indefinitely (demonstrated below).

SAD_BUS.mp4

As a Battle Bus gains 250 health when entering bunkered mode (400 health → 650 health), the subdual damage threshold can be shifted above the current subdual damage and thus cause the Battle Bus to remain subdued forever. To rectify this, the subdual damage is set to the threshold (max health) on transitioning to the bunkered state to ensure the subdued state is removed when healed.

@Stubbjax Stubbjax self-assigned this Sep 19, 2025
@Stubbjax Stubbjax added Bug Something is not working right, typically is user facing GLA Affects GLA faction Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour NoRetail This fix or change is not applicable with Retail game compatibility labels Sep 19, 2025
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.

Nice.

if (isSubdued())
{
const UndeadBodyModuleData* data = getUndeadBodyModuleData();
internalAddSubdualDamage(data->m_secondLifeMaxHealth - getCurrentSubdualDamageAmount());
Copy link

Choose a reason for hiding this comment

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

As a Battle Bus gains 250 health when entering bunkered mode (400 health → 650 health), the subdual damage threshold can be shifted above the current subdual damage and thus cause the Battle Bus to remain subdued forever. To rectify this, the subdual damage is set to the threshold (max health) on transitioning to the bunkered state to ensure the subdued state is removed when healed.

This observation makes me wonder if it is desireable that a unit can get stuck in subdual to begin with. Where does this happen and is there maybe another way to fix this universally, so that even in these scenarios the sub dual damage can recover on its own?

Copy link
Author

Choose a reason for hiding this comment

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

That's a good point, and would explain why I've seen it happen to disabled tanks when the Composite Armour upgrade was likely timed with the disable. I'll look at updating the subdue status in the setMaxHealth method instead.

Copy link

Choose a reason for hiding this comment

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

Do you know why the subdue gets stuck when the health is wrong?

Copy link
Author

Choose a reason for hiding this comment

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

Essentially because wasSubdued and isSubdued can both return false after a max health increase and so onSubdualChange is never triggered.

If we inline the logic, it looks like this:

bool wasSubdued = m_maxHealth <= m_currentSubdualDamage;
internalAddSubdualDamage(amount);
bool nowSubdued = m_maxHealth <= m_currentSubdualDamage;

if (wasSubdued != nowSubdued)
  onSubdualChange(nowSubdued);

But now looking at it, I think there is a cleaner solution:

bool wasSubdued = getObject()->isDisabledByType(DISABLED_SUBDUED);
internalAddSubdualDamage(amount);
bool nowSubdued = m_maxHealth <= m_currentSubdualDamage;

if (wasSubdued != nowSubdued)
  onSubdualChange(nowSubdued);

Copy link

Choose a reason for hiding this comment

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

Yes, that makes a lot of sense. Fixing the root of the issue.

@xezon xezon changed the title bugfix: Battle Bus can no longer be subdued indefinitely bugfix(module): GLA Battle Bus can no longer be subdued indefinitely Sep 24, 2025
@xezon xezon merged commit 5ba1741 into TheSuperHackers:main Sep 25, 2025
27 of 34 checks passed
@Stubbjax Stubbjax deleted the fix-battle-bus-subdued-indefinitely branch September 26, 2025 04:36
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 GLA Affects GLA faction 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