From 2372c6d4fde7294ee00166df07e803af1655f5ef Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Tue, 17 Apr 2007 18:34:40 +0000 Subject: [PATCH] Fixed Tux picking up dead BadGuys: Will no longer pick up objects in collision group COLGROUP_DISABLED SVN-Revision: 4995 --- src/object/player.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- 2.11.0