Owl badguy: Fix turn-around behavior.
authorflorianf <florianf@837edb03-e0f3-0310-88ca-d4d4e8b29345>
Tue, 9 Mar 2010 13:05:45 +0000 (13:05 +0000)
committerflorianf <florianf@837edb03-e0f3-0310-88ca-d4d4e8b29345>
Tue, 9 Mar 2010 13:05:45 +0000 (13:05 +0000)
Turning back to the initial direction was broken.

git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6588 837edb03-e0f3-0310-88ca-d4d4e8b29345

src/badguy/owl.cpp

index 152def3..db8b2fe 100644 (file)
@@ -137,10 +137,12 @@ Owl::collision_solid(const CollisionHit& hit)
   } else if(hit.left || hit.right) {
     if (dir == LEFT) {
       set_action ("right", /* loops = */ -1);
+      dir = RIGHT;
       physic.set_velocity_x (FLYING_SPEED);
     }
     else {
       set_action ("left", /* loops = */ -1);
+      dir = LEFT;
       physic.set_velocity_x (-FLYING_SPEED);
     }
   }