Skip to content

Optimize power brownout changes #3702

Open
Open

Description

@Caball009

void Energy::addProduction(Int amt)
{
m_energyProduction += amt;
if( m_owner == nullptr )
return;
// A repeated Brownout signal does nothing bad, and we need to handle more than just edge cases.
// Like low power, now even more low power, refresh disable.
m_owner->onPowerBrownOutChange( !hasSufficientPower() );
}

void Energy::addConsumption(Int amt)
{
m_energyConsumption += amt;
if( m_owner == nullptr )
return;
m_owner->onPowerBrownOutChange( !hasSufficientPower() );
}

The call to onPowerBrownOutChange can be avoided if there was no change in energy and controlling player.

Activity

  1. added theissue type on Nov 19, 2026
  2. coderabbitai commented on Nov 19, 2026

    @coderabbitai
    🔗 Related PRs

    #3574 - bugfix(object): Add support for object that has POWERED KindOf type without power [open]


    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions