From: Christoph Sommer Date: Tue, 17 Apr 2007 18:34:40 +0000 (+0000) Subject: Fixed Tux picking up dead BadGuys: Will no longer pick up objects in collision group... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2372c6d4fde7294ee00166df07e803af1655f5ef;p=supertux.git Fixed Tux picking up dead BadGuys: Will no longer pick up objects in collision group COLGROUP_DISABLED SVN-Revision: 4995 --- diff --git a/src/object/player.cpp b/src/object/player.cpp index d070c2952..7ce6363da 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -701,11 +701,16 @@ Player::try_grab() if(!portable->is_portable()) continue; + // make sure the Portable is a MovingObject MovingObject* moving_object = dynamic_cast (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;