From e58693488206b81cb24268b8ecb5947651c39b18 Mon Sep 17 00:00:00 2001 From: Drekken Date: Thu, 21 Dec 2023 10:29:42 -0500 Subject: [PATCH] Fix zergling maneuver bug and rename method to find closest enemy pylon --- bot/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bot/main.py b/bot/main.py index 1ace93d..a8f2154 100644 --- a/bot/main.py +++ b/bot/main.py @@ -78,8 +78,8 @@ def do_zergling_engagement( closest_enemy: Unit = cy_closest_to(zergling.position, enemies) # Use zergling.position if closest_enemy: zergling_maneuver.add(StutterUnitBack(zergling, closest_enemy)) - - zergling_maneuver.add(AMove(zergling, attack_target)) + else: + zergling_maneuver.add(AMove(zergling, attack_target)) self.register_behavior(zergling_maneuver) def do_roach_pylon_attack( @@ -98,7 +98,7 @@ def do_roach_pylon_attack( The ground grid for pathing information. """ enemy_start_location = self.enemy_start_locations[0] - enemy_pylon = self._find_enemy_pylon() + enemy_pylon = self._close_enemy_pylon() for roach in roaches: roach_maneuver = CombatManeuver() @@ -115,7 +115,7 @@ def do_roach_pylon_attack( self.register_behavior(roach_maneuver) - def _find_enemy_pylon(self) -> Unit: + def _close_enemy_pylon(self) -> Unit: """Find the enemy pylon to target.""" pylons = self.enemy_structures(UnitTypeId.PYLON) if pylons: