Skip to content

Commit

Permalink
Merge pull request #213 from AresSC2/fix/spawn-controller-action-befo…
Browse files Browse the repository at this point in the history
…re-step-complete

fix: ensure spawn controller did an action before marking step started
  • Loading branch information
raspersc2 authored Jan 31, 2025
2 parents aae3d56 + ccc0d30 commit 95557f1
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/ares/build_runner/build_order_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,17 +338,18 @@ async def do_step(self, step: BuildOrderStep) -> None:
elif isinstance(command, UnitID) and command not in ALL_STRUCTURES:
army_comp: dict = {command: {"proportion": 1.0, "priority": 0}}
spawn_target: Point2 = self._get_target(step.target)
SpawnController(
did_spawn_action: bool = SpawnController(
army_comp, freeflow_mode=True, maximum=1, spawn_target=spawn_target
).execute(self.ai, self.config, self.mediator)
if (
UpgradeId.WARPGATERESEARCH in self.ai.state.upgrades
and command in GATEWAY_UNITS
):
# main.on_unit_created will set self.current_step_started = True
pass
else:
self.current_step_started = True
if did_spawn_action:
if (
UpgradeId.WARPGATERESEARCH in self.ai.state.upgrades
and command in GATEWAY_UNITS
):
# main.on_unit_created will set self.current_step_started = True
pass
else:
self.current_step_started = True

elif isinstance(command, UpgradeId):
self.current_step_started = True
Expand Down

0 comments on commit 95557f1

Please sign in to comment.