fix: en lazy load, al eixir havia cridades a singletons morts
This commit is contained in:
@@ -71,13 +71,15 @@ Game::Game(Mode mode)
|
||||
game_backbuffer_surface_ = std::make_shared<Surface>(Options::game.width, Options::game.height);
|
||||
changeRoom(current_room_);
|
||||
|
||||
if (Console::get() != nullptr) {
|
||||
#ifdef _DEBUG
|
||||
Console::get()->setScope("debug");
|
||||
Console::get()->setScope("debug");
|
||||
#else
|
||||
Console::get()->setScope("game");
|
||||
Console::get()->setScope("game");
|
||||
#endif
|
||||
Console::get()->on_toggle = [this](bool open) { player_->setIgnoreInput(open); };
|
||||
if (Console::get()->isActive()) { player_->setIgnoreInput(true); }
|
||||
Console::get()->on_toggle = [this](bool open) { player_->setIgnoreInput(open); };
|
||||
if (Console::get()->isActive()) { player_->setIgnoreInput(true); }
|
||||
}
|
||||
GameControl::change_player_skin = [this](const std::string& skin_name) -> void {
|
||||
Options::game.player_skin = skin_name;
|
||||
player_->setSkin(skin_name);
|
||||
@@ -172,7 +174,7 @@ Game::~Game() {
|
||||
|
||||
GameControl::change_player_skin = nullptr;
|
||||
GameControl::change_player_color = nullptr;
|
||||
Console::get()->on_toggle = nullptr;
|
||||
if (Console::get() != nullptr) { Console::get()->on_toggle = nullptr; }
|
||||
|
||||
#ifdef _DEBUG
|
||||
GameControl::change_room = nullptr;
|
||||
@@ -181,7 +183,7 @@ Game::~Game() {
|
||||
GameControl::toggle_debug_mode = nullptr;
|
||||
GameControl::set_initial_room = nullptr;
|
||||
GameControl::set_initial_pos = nullptr;
|
||||
if (MapEditor::get()->isActive()) { MapEditor::get()->exit(); }
|
||||
if (MapEditor::get() != nullptr && MapEditor::get()->isActive()) { MapEditor::get()->exit(); }
|
||||
GameControl::enter_editor = nullptr;
|
||||
GameControl::exit_editor = nullptr;
|
||||
GameControl::revert_editor = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user