From 30d5c7488d64055a1df11a51b78bedcad6a8c76e Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 18 Sep 2016 19:25:51 +0200 Subject: [PATCH] savegamedialog: don't reset the character selection scrollbar when a character is deleted --- apps/openmw/mwgui/savegamedialog.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/savegamedialog.cpp b/apps/openmw/mwgui/savegamedialog.cpp index c4d9bae30..5187c3043 100644 --- a/apps/openmw/mwgui/savegamedialog.cpp +++ b/apps/openmw/mwgui/savegamedialog.cpp @@ -91,15 +91,17 @@ namespace MWGui if (mSaveList->getItemCount() == 0) { - // The character might be deleted now size_t previousIndex = mCharacterSelection->getIndexSelected(); - open(); + mCurrentCharacter = NULL; + mCharacterSelection->removeItemAt(previousIndex); if (mCharacterSelection->getItemCount()) { size_t nextCharacter = std::min(previousIndex, mCharacterSelection->getItemCount()-1); mCharacterSelection->setIndexSelected(nextCharacter); onCharacterSelected(mCharacterSelection, nextCharacter); } + else + fillSaveList(); } }