Make tux and yeti dying state not reveal secret tilemaps
authorTobias Markus <tobbi@mozilla-uk.org>
Sun, 8 Mar 2015 15:26:58 +0000 (16:26 +0100)
committerTobias Markus <tobbi@mozilla-uk.org>
Sun, 8 Mar 2015 15:26:58 +0000 (16:26 +0100)
src/badguy/yeti.cpp
src/object/player.cpp

index 26c47d6..8d1b49b 100644 (file)
@@ -212,6 +212,9 @@ void Yeti::take_hit(Player& )
     physic.set_velocity_x(0);
     physic.set_velocity_y(0);
 
+    // Set the badguy layer to be above the foremost, so that
+    // this does not reveal secret tilemaps:
+    layer = Sector::current()->get_foremost_layer() + 1;
     state = SQUISHED;
     state_timer.start(YETI_SQUISH_TIME);
     set_colgroup_active(COLGROUP_MOVING_ONLY_STATIC);
index 7aa2004..7fa5983 100644 (file)
@@ -1312,7 +1312,11 @@ Player::draw(DrawingContext& context)
     }
   }
   else {
-    sprite->draw(context, get_pos(), LAYER_OBJECTS + 1);
+    if(dying)
+      sprite->draw(context, get_pos(), Sector::current()->get_foremost_layer() + 1);
+    else
+      sprite->draw(context, get_pos(), LAYER_OBJECTS + 1);
+
     if (player_status->bonus == AIR_BONUS)
       powersprite->draw(context, get_pos(), LAYER_OBJECTS + 1);
   }