From bcb361a37aaa1e01f80d700f69735f4cd7ac50fc Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Sat, 1 May 2004 15:46:08 +0000 Subject: [PATCH] - improved verboseness of badguy in wall error message - fixed bug that caused tux to only high jump to the right SVN-Revision: 912 --- src/badguy.cpp | 12 +++++++----- src/player.cpp | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/badguy.cpp b/src/badguy.cpp index 8486f3a95..b879dcbca 100644 --- a/src/badguy.cpp +++ b/src/badguy.cpp @@ -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 diff --git a/src/player.cpp b/src/player.cpp index 90a9d6b34..d6f60e98b 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -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); -- 2.11.0