fix pause bug when monitor isn't present

This commit is contained in:
Chris Cromer 2022-09-01 12:26:26 -04:00
parent 083db48f04
commit d560d13627
Signed by: cromer
GPG Key ID: FA91071797BEEEC2

View File

@ -90,8 +90,7 @@ void alai::Main::_on_monitor_loaded()
{
load_level();
auto event = get_node<alai::Event>("/root/Event");
event->emit_signal("level_loaded");
get_tree()->set_pause(true);
event->emit_signal("level_loaded");
}
void alai::Main::load_monitor()
@ -100,6 +99,7 @@ void alai::Main::load_monitor()
event->connect("monitor_loaded", this, "_on_monitor_loaded");
godot::Ref<godot::PackedScene> monitor_scene = _resource_loader->load("res://monitor/Monitor.tscn");
add_child(monitor_scene->instance());
get_tree()->set_pause(true);
}
void alai::Main::load_level()