From ad45709eea797289346f33db1aae978a66e49a98 Mon Sep 17 00:00:00 2001 From: LMH Date: Tue, 3 Sep 2013 14:31:37 -1000 Subject: [PATCH] Icecrusher will no longer drop if there are static solids between it and Tux, resolves bug 1012 --- src/object/icecrusher.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.11.0