Icecrusher will no longer drop if there are static solids between it and Tux, resolve...
authorLMH <lmh.0013@gmail.com>
Wed, 4 Sep 2013 00:31:37 +0000 (14:31 -1000)
committerTobias Markus <tobbi@mozilla-uk.org>
Sat, 26 Oct 2013 16:45:21 +0000 (18:45 +0200)
src/object/icecrusher.cpp

index ac06fbc..58f3376 100644 (file)
@@ -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;