Fix dedicated server not going to lobby instantly

This commit is contained in:
Sofia 2026-08-15 00:34:23 +03:00
parent 158bd3252d
commit 6ea9bc27a3

View File

@ -51,14 +51,20 @@ impl IPanel for GameFinishedScreen {
.connect_other(self, Self::save_replay); .connect_other(self, Self::save_replay);
} }
if let Some(game) = &mut Game::singleton() if let Some(game) = &mut Game::singleton() {
&& let Some(recorder) = &mut game.bind_mut().replay_recorder if let Some(recorder) = &mut game.bind_mut().replay_recorder {
{
recorder recorder
.signals() .signals()
.on_saved() .on_saved()
.connect_other(self, Self::on_replay_saved); .connect_other(self, Self::on_replay_saved);
} }
if game.bind().is_host() && game.bind().self_id.is_none() {
game.bind_mut().reset_game();
self.run_deferred(|_| {
GameManager::singleton().bind().go_to_lobby();
});
}
}
if let Some(focus) = &mut self.base_mut().find_next_valid_focus() { if let Some(focus) = &mut self.base_mut().find_next_valid_focus() {
focus.grab_focus(); focus.grab_focus();