From d8c4e7ab615a1d81ff3ba7d8a967f3dd2f250abc Mon Sep 17 00:00:00 2001
From: Wintermute <wintermute@hannover.ccc.de>
Date: Sat, 19 Oct 2013 14:13:51 +0200
Subject: [PATCH] =?utf8?q?Pilzverhalten:=20L=C3=A4uft=20unter=20Spieler=20?=
 =?utf8?q?hin=20und=20her.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

---
 badge/jumpnrun/enemies.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/badge/jumpnrun/enemies.c b/badge/jumpnrun/enemies.c
index cc72db3..914d342 100644
--- a/badge/jumpnrun/enemies.c
+++ b/badge/jumpnrun/enemies.c
@@ -280,13 +280,12 @@ void enemy_tick_straight_follow(jumpnrun_enemy            *self,
   self->type->collision_player(self, state, player_inertia_mod);
   rectangle_move_to(&self->base.current_box, new_pos);
 
-  if(fixed_point_le(rectangle_mid_x(&state->player.current_box), rectangle_mid_x(enemy_box(self)))) {
+  if(fixed_point_lt(rectangle_right(&state->player.current_box), rectangle_left(enemy_box(self)))) {
     self->base.inertia.x = self->type->spawn_inertia.x;
-  } else {
+  } else if(fixed_point_gt(rectangle_left(&state->player.current_box), rectangle_right(enemy_box(self)))) {
     self->base.inertia.x = fixed_point_neg(self->type->spawn_inertia.x);
   }
 
-
   enemy_animation_advance(self);
 }
 
-- 
2.20.1