Climbable areas don't influence Tux at all while he is carrying something.
authorWolfgang Becker <uafr@gmx.de>
Sat, 23 Aug 2008 14:17:08 +0000 (14:17 +0000)
committerWolfgang Becker <uafr@gmx.de>
Sat, 23 Aug 2008 14:17:08 +0000 (14:17 +0000)
SVN-Revision: 5738

src/trigger/climbable.cpp

index 3a498d7..7ec2af1 100644 (file)
@@ -103,16 +103,18 @@ void
 Climbable::event(Player& player, EventType type)
 {
   if ((type == EVENT_ACTIVATE) || (activate_try_timer.started())) {
-    if (may_climb(player)) {
-      climbed_by = &player;
-      player.start_climbing(*this);
-      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));
-      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));
+    if(player.get_grabbed_object() == NULL){
+      if(may_climb(player)) {
+        climbed_by = &player;
+        player.start_climbing(*this);
+        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));
+        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));
+      }
     }
   }
   if(type == EVENT_LOSETOUCH) {