From 403058ba1e31330689f9b36a10384ee0b2e8ebde Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Fri, 28 Aug 2015 14:19:22 +0200 Subject: hopefully fixed "enemy in our midpoint" issue --- strategy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/strategy.py b/strategy.py index 2ea84e2..1a57897 100644 --- a/strategy.py +++ b/strategy.py @@ -196,11 +196,12 @@ class Strategy: if ( (not cell.is_virus and dist < ((500+2*cell.size) if cell.mass > 1.25*my_smallest.mass*2 else (300+cell.size)) and cell.mass > 1.25 * my_smallest.mass) or (cell.is_virus and dist < my_largest.mass and cell.mass < my_largest.mass) ) and not (cell in friendly_cells) or (cell in friendly_cells) and dist < cell.size+10: try: angle = math.atan2(relpos[1],relpos[0]) - corridor_halfwidth = math.asin(cell.size / dist) + corridor_halfwidth = math.asin(min(1, cell.size / dist)) forbidden_intervals += canonicalize_angle_interval((angle-corridor_halfwidth, angle+corridor_halfwidth)) runaway = True except: print("TODO FIXME: need to handle enemy cell which is in our centerpoint!") + raise # wall avoidance if self.c.player.center[0] < self.c.world.top_left[1]+(self.c.player.total_size*2): -- cgit v1.2.1