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;
// 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);
}
}
+void
+Sector::resume_music()
+{
+ if(SoundManager::current()->get_current_music() == music)
+ {
+ SoundManager::current()->resume_music(3.2f);
+ }
+ else
+ {
+ SoundManager::current()->stop_music();
+ SoundManager::current()->play_music(music, true);
+ }
+}
+
MusicType
Sector::get_music_type()
{