Skip to content

Commit

Permalink
Merge pull request #144 from AresSC2/feat/improve-stuuter-group-back
Browse files Browse the repository at this point in the history
fix: out of map bounds
  • Loading branch information
raspersc2 authored Jun 2, 2024
2 parents cca6c20 + 521c363 commit 71c7a04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ares/behaviors/combat/group/stutter_group_back.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def calculate_retreat_position(self, ai: "AresBot") -> Point2:
retreat_position: Point2 = self.group_position + direction * distance
retreat_position = Point2(
(
max(0, min(map_bounds[0], retreat_position.x)),
max(0, min(map_bounds[1], retreat_position.y)),
max(0, min(map_bounds[0] - 1, retreat_position.x)),
max(0, min(map_bounds[1] - 1, retreat_position.y)),
)
)

Expand Down

0 comments on commit 71c7a04

Please sign in to comment.