From: LMH Date: Wed, 4 Sep 2013 00:31:37 +0000 (-1000) Subject: Icecrusher will no longer drop if there are static solids between it and Tux, resolve... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0b2fff94911c939827179da452edc352b5c6f84a;p=supertux.git Icecrusher will no longer drop if there are static solids between it and Tux, resolves bug 1012 --- diff --git a/src/object/icecrusher.cpp b/src/object/icecrusher.cpp index ac06fbc62..58f337607 100644 --- a/src/object/icecrusher.cpp +++ b/src/object/icecrusher.cpp @@ -258,9 +258,11 @@ IceCrusher::found_victim() const Rectf& player_bbox = player->get_bbox(); const Rectf& crusher_bbox = get_bbox(); + Rectf crush_area = Rectf(crusher_bbox.p1.x+1, crusher_bbox.p2.y, crusher_bbox.p2.x-1, std::max(crusher_bbox.p2.y,player_bbox.p1.y-1)); if ((player_bbox.p1.y >= crusher_bbox.p2.y) /* player is below crusher */ && (player_bbox.p2.x > (crusher_bbox.p1.x - DROP_ACTIVATION_DISTANCE)) - && (player_bbox.p1.x < (crusher_bbox.p2.x + DROP_ACTIVATION_DISTANCE))) + && (player_bbox.p1.x < (crusher_bbox.p2.x + DROP_ACTIVATION_DISTANCE)) + && (Sector::current()->is_free_of_statics(crush_area, this, false))/* and area to player is free of objects */) return true; else return false;