Owl badguy: Fix turn-around behavior.
authorFlorian Forster <supertux@octo.it>
Tue, 9 Mar 2010 13:05:45 +0000 (13:05 +0000)
committerFlorian Forster <supertux@octo.it>
Tue, 9 Mar 2010 13:05:45 +0000 (13:05 +0000)
Turning back to the initial direction was broken.

SVN-Revision: 6588

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);
     }
   }