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.
This commit is contained in:
Kelsi 2026-05-06 03:00:10 -07:00
parent 11f0580ccb
commit 848947604e

View file

@ -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);