From a84a3374b7748ddeb89796e6956a118f44d85203 Mon Sep 17 00:00:00 2001 From: LMH Date: Tue, 3 Sep 2013 14:47:41 -1000 Subject: [PATCH] Added a negative y-velocity component to horizontal climbing alignment adjustment to prevent Tux from walking in place temporarily when trying to climb from a standing position --- src/trigger/climbable.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/trigger/climbable.cpp b/src/trigger/climbable.cpp index 35ccc0605..1d7eb66e3 100644 --- a/src/trigger/climbable.cpp +++ b/src/trigger/climbable.cpp @@ -91,8 +91,9 @@ Climbable::event(Player& player, EventType type) activate_try_timer.stop(); } else { if (type == EVENT_ACTIVATE) activate_try_timer.start(ACTIVATE_TRY_FOR); - if (player.get_bbox().p1.x < get_bbox().p1.x - GRACE_DX) player.add_velocity(Vector(POSITION_FIX_AX,0)); - if (player.get_bbox().p2.x > get_bbox().p2.x + GRACE_DX) player.add_velocity(Vector(-POSITION_FIX_AX,0)); + // the "-13" to y velocity prevents Tux from walking in place on the ground for horizonal adjustments + if (player.get_bbox().p1.x < get_bbox().p1.x - GRACE_DX) player.add_velocity(Vector(POSITION_FIX_AX,-13)); + if (player.get_bbox().p2.x > get_bbox().p2.x + GRACE_DX) player.add_velocity(Vector(-POSITION_FIX_AX,-13)); if (player.get_bbox().p1.y < get_bbox().p1.y - GRACE_DY) player.add_velocity(Vector(0,POSITION_FIX_AY)); if (player.get_bbox().p2.y > get_bbox().p2.y + GRACE_DY) player.add_velocity(Vector(0,-POSITION_FIX_AY)); } -- 2.11.0