Skip to content

Commit

Permalink
Fix zergling maneuver bug and rename method to find closest enemy pylon
Browse files Browse the repository at this point in the history
  • Loading branch information
Drekken committed Dec 21, 2023
1 parent b2d93aa commit e586934
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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()
Expand All @@ -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:
Expand Down

0 comments on commit e586934

Please sign in to comment.