X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fsupertux%2Fsector.cpp;h=c9879c9c0056c7f3d8d7dc1cb50d67f3d960d219;hb=2740fa90c947ec4d1ff9c7d3eeb12cf31ce4d26e;hp=a2afe93e9bc0c77a423cbec55c94488e96251cc7;hpb=d097f456b8ab4f42058545bdd4f8f676d151e974;p=supertux.git diff --git a/src/supertux/sector.cpp b/src/supertux/sector.cpp index a2afe93e9..c9879c9c0 100644 --- a/src/supertux/sector.cpp +++ b/src/supertux/sector.cpp @@ -115,8 +115,15 @@ Sector::Sector(Level* parent) : Sector::~Sector() { using namespace scripting; + try + { + deactivate(); + } + catch(const std::exception& err) + { + log_warning << err.what() << std::endl; + } - deactivate(); for(auto i = scripts.begin(); i != scripts.end(); ++i) { HSQOBJECT& object = *i; @@ -587,7 +594,8 @@ Sector::activate(const Vector& player_pos) // spawning tux in the ground would kill him if(!is_free_of_tiles(p->get_bbox())) { - log_warning << "Tried spawning Tux in solid matter. Compensating." << std::endl; + std::string current_level = "[" + Sector::current()->get_level()->filename + "] "; + log_warning << current_level << "Tried spawning Tux in solid matter. Compensating." << std::endl; Vector npos = p->get_bbox().p1; npos.y-=32; p->move(npos);