Fixed Tux picking up dead BadGuys: Will no longer pick up objects in collision group...
authorChristoph Sommer <mail@christoph-sommer.de>
Tue, 17 Apr 2007 18:34:40 +0000 (18:34 +0000)
committerChristoph Sommer <mail@christoph-sommer.de>
Tue, 17 Apr 2007 18:34:40 +0000 (18:34 +0000)
SVN-Revision: 4995

src/object/player.cpp

index d070c29..7ce6363 100644 (file)
@@ -701,11 +701,16 @@ Player::try_grab()
       if(!portable->is_portable())
         continue;
 
+      // make sure the Portable is a MovingObject
       MovingObject* moving_object = dynamic_cast<MovingObject*> (portable);
-      assert(portable);
+      assert(moving_object);
       if(moving_object == NULL)
         continue;
 
+      // make sure the Portable isn't currently non-solid
+      if(moving_object->get_group() == COLGROUP_DISABLED) continue;
+
+      // check if we are within reach
       if(moving_object->get_bbox().contains(pos)) {
         if (climbing) stop_climbing(*climbing);
         grabbed_object = portable;