From 848947604eed700fb0934c3b6e36420756abb45f Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 03:00:10 -0700 Subject: [PATCH] fix(editor): quit-confirm dialog also triggers for unsaved object/NPC/quest changes Previously only terrain edits would trigger the 'unsaved changes' prompt on quit, so a user who only added NPCs or quests could lose their work by closing the window. Now checks autoSavePendingChanges_ alongside terrain dirty state. --- tools/editor/editor_app.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/editor/editor_app.cpp b/tools/editor/editor_app.cpp index 52c91898..5fa4a7fb 100644 --- a/tools/editor/editor_app.cpp +++ b/tools/editor/editor_app.cpp @@ -277,7 +277,10 @@ void EditorApp::processEvents() { ImGui_ImplSDL2_ProcessEvent(&event); if (event.type == SDL_QUIT) { - if (terrain_.isLoaded() && terrainEditor_.hasUnsavedChanges()) { + // Confirm-on-quit fires for any unsaved change — terrain edits OR + // object/NPC/quest changes (autoSavePendingChanges_). + bool dirty = terrainEditor_.hasUnsavedChanges() || autoSavePendingChanges_; + if (terrain_.isLoaded() && dirty) { showQuitConfirm_ = true; } else { window_->setShouldClose(true);