Using filename instead of author and level name
[supertux.git] / src / badguy / badguy.cpp
index 51b701a..68187b6 100644 (file)
@@ -31,6 +31,7 @@ static const float SQUISH_TIME = 2;
   
 static const float X_OFFSCREEN_DISTANCE = 1280;
 static const float Y_OFFSCREEN_DISTANCE = 800;
+static const int LAYER_FALLING = 500;
 
 BadGuy::BadGuy(const Vector& pos, const std::string& sprite_name, int layer) :
   MovingSprite(pos, sprite_name, layer, COLGROUP_DISABLED), 
@@ -146,7 +147,8 @@ BadGuy::update(float elapsed_time)
       int path_chars = badguy.rfind("/",badguy.length());
       badguy = badguy.substr(path_chars + 1, badguy.length() - path_chars);
       // log warning since badguys_killed can no longer reach total_badguys
-      log_warning << "Counted badguy " << badguy << " starting at " << start_position << " has left the sector" <<std::endl;;
+      std::string current_level = "[" + Sector::current()->get_level()->filename + "] ";
+      log_warning << current_level << "Counted badguy " << badguy << " starting at " << start_position << " has left the sector" <<std::endl;;
     }
     return;
   }
@@ -394,6 +396,7 @@ BadGuy::kill_fall()
   physic.set_acceleration_y(0);
   physic.enable_gravity(true);
   set_state(STATE_FALLING);
+  layer = LAYER_FALLING;
 
   // start dead-script
   run_dead_script();