From 7017f8b4dc12e10a5ce052548acd4521c10cfb9d Mon Sep 17 00:00:00 2001 From: mlangkabel Date: Mon, 3 Aug 2026 21:13:43 +0200 Subject: [PATCH] route the win-path restart through ResetCommand --- src/ui/MainWindow.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ui/MainWindow.cpp b/src/ui/MainWindow.cpp index 2b2acb5..2dedab7 100644 --- a/src/ui/MainWindow.cpp +++ b/src/ui/MainWindow.cpp @@ -419,10 +419,12 @@ void MainWindow::handleEvent(std::shared_ptr /*event*/) { return; } - // Unlike the other two restart paths this one resets the simulation - // directly instead of enqueueing a ResetCommand; kept as-is. - m_sim->reset(std::move(*newConfig)); - m_gameWorldView->resetForNewGame(); + // Restart is a command boundary; the view resets when the drain applies it. + std::shared_ptr command = std::make_shared(); + command->config = std::make_shared(std::move(*newConfig)); + command->seed = std::random_device{}(); + EventManager::getInstance()->sendEventImmediately( + std::make_shared(command)); } else {