From 3863194a207a467b281a5fe6d9c394df3fad75aa Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Mon, 16 Apr 2007 20:01:25 +0000 Subject: [PATCH] Invisible block solidity now applies to all objects, not only Tux SVN-Revision: 4992 --- src/object/invisible_block.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/object/invisible_block.cpp b/src/object/invisible_block.cpp index 045e31999..19922bda5 100644 --- a/src/object/invisible_block.cpp +++ b/src/object/invisible_block.cpp @@ -46,17 +46,17 @@ InvisibleBlock::draw(DrawingContext& context) HitResponse InvisibleBlock::collision(GameObject& other, const CollisionHit& hit) { - if(!visible) { - Player* player = dynamic_cast (&other); - if(player) { - if(player->get_movement().y > 0 || - player->get_bbox().get_top() <= get_bbox().get_bottom() - 7.0) { - return PASSTHROUGH; - } - } + if (visible) return Block::collision(other, hit); + + // if we're not visible, only register a collision if this will make us visible + Player* player = dynamic_cast (&other); + if ((player) + && (player->get_movement().y <= 0) + && (player->get_bbox().get_top() > get_bbox().get_bottom() - 7.0)) { + return Block::collision(other, hit); } - return Block::collision(other, hit); + return PASSTHROUGH; } void -- 2.11.0