- improved verboseness of badguy in wall error message
authorIngo Ruhnke <grumbel@gmx.de>
Sat, 1 May 2004 15:46:08 +0000 (15:46 +0000)
committerIngo Ruhnke <grumbel@gmx.de>
Sat, 1 May 2004 15:46:08 +0000 (15:46 +0000)
- fixed bug that caused tux to only high jump to the right

SVN-Revision: 912

src/badguy.cpp
src/player.cpp

index 8486f3a..b879dcb 100644 (file)
@@ -193,11 +193,13 @@ BadGuy::BadGuy(float x, float y, BadGuyKind kind_, bool stay_on_platform_)
   }
 
   // if we're in a solid tile at start correct that now
-  if(kind != BAD_FLAME && kind != BAD_FISH && collision_object_map(base)) {
-    printf("Warning: badguy started in wall!.\n");
-    while(collision_object_map(base))
-      --base.y;
-  }
+  if(kind != BAD_FLAME && kind != BAD_FISH && collision_object_map(base)) 
+    {
+      std::cout << "Warning: badguy started in wall: kind: " << badguykind_to_string(kind) 
+                << " pos: (" << base.x << ", " << base.y << ")" << std::endl;
+      while(collision_object_map(base))
+        --base.y;
+    }
 }
 
 void
index 90a9d6b..d6f60e9 100644 (file)
@@ -378,7 +378,7 @@ Player::handle_vertical_input()
       if (on_ground())
         {
           // jump higher if we are running
-          if (physic.get_velocity_x() > MAX_WALK_XM)
+          if (fabs(physic.get_velocity_x()) > MAX_WALK_XM)
             physic.set_velocity_y(5.8);
           else
             physic.set_velocity_y(5.2);