Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix non move multi boosts #171

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

ikiris
Copy link

@ikiris ikiris commented May 19, 2020

Pull request summary

Description:

Fixes boosting on dev branch when doing multiple boosts.

Fixed:

Non move boosts when doing multiple boosts.

  • None

Testing checklist:

  • [X ] Changes are backward-compatible OR version migration code is included
  • [X ] Codebase compiles with current tsconfig configuration
  • [X ] Tested changes on {choose PUBLIC/PRIVATE} server OR changes are trivial (e.g. typos)

@@ -602,7 +602,7 @@ export abstract class Overlord {
const [moveBoosts, nonMoveBoosts] = _.partition(neededBoostResources,
resource => Abathur.isMoveBoost(<ResourceConstant>resource));

for (const boost of [...moveBoosts, nonMoveBoosts]) { // try to get move boosts first if they're available
for (const boost of [...moveBoosts, ...nonMoveBoosts]) { // try to get move boosts first if they're available
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd change this to have typescript help a little:

      const neededBoosts = zerg.getNeededBoosts();
      const neededBoostResources = _.keys(neededBoosts) as MineralBoostConstant[];

      const [moveBoosts, nonMoveBoosts] = _.partition(neededBoostResources,
                              resource => Abathur.isMoveBoost(<ResourceConstant>resource));

      for (const boost of [...moveBoosts, ...nonMoveBoosts]) { // try to get move boosts first if they're available
        const b: MineralBoostConstant = boost; // Have the types help ensure correctness.
        const boostLab = _.find(evolutionChamber.boostingLabs, lab => lab.mineralType === b);
        if (boostLab) {
          zerg.task = Tasks.getBoosted(boostLab, <ResourceConstant>boost);
          return;
        }
      }

Other than that, LGTM.

zGeneral pushed a commit to zGeneral/Overmind that referenced this pull request Jan 4, 2021
@tiennou tiennou mentioned this pull request Feb 2, 2024
3 tasks
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.

2 participants