From abd6b6ab33700af01fc2c4e6394da29f02d4e0e8 Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 20 May 2014 17:11:26 +0200 Subject: [PATCH] Fix not returning to main menu on failed loads when using quickload --- apps/openmw/mwgui/savegamedialog.cpp | 6 ------ apps/openmw/mwstate/statemanagerimp.cpp | 2 ++ apps/openmw/mwworld/worldimp.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/apps/openmw/mwgui/savegamedialog.cpp b/apps/openmw/mwgui/savegamedialog.cpp index c0daa2c0e..16e939eb2 100644 --- a/apps/openmw/mwgui/savegamedialog.cpp +++ b/apps/openmw/mwgui/savegamedialog.cpp @@ -222,12 +222,6 @@ namespace MWGui MWBase::Environment::get().getStateManager()->loadGame (mCurrentCharacter, mCurrentSlot); } } - - if (MWBase::Environment::get().getStateManager()->getState()== - MWBase::StateManager::State_NoGame) - { - MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_MainMenu); - } } void SaveGameDialog::onOkButtonClicked(MyGUI::Widget *sender) diff --git a/apps/openmw/mwstate/statemanagerimp.cpp b/apps/openmw/mwstate/statemanagerimp.cpp index 48c7508a6..43972e9f9 100644 --- a/apps/openmw/mwstate/statemanagerimp.cpp +++ b/apps/openmw/mwstate/statemanagerimp.cpp @@ -371,6 +371,8 @@ void MWState::StateManager::loadGame (const Character *character, const Slot *sl { std::cerr << "failed to load saved game: " << e.what() << std::endl; cleanup (true); + + MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_MainMenu); } } diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index f8523726e..d5e572b13 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -233,6 +233,10 @@ namespace MWWorld if (!bypass) MWBase::Environment::get().getWindowManager()->playVideo(mFallback.getFallbackString("Movies_New_Game"), true); + // enable collision + if (!mPhysics->toggleCollisionMode()) + mPhysics->toggleCollisionMode(); + // we don't want old weather to persist on a new game delete mWeatherManager; mWeatherManager = 0; @@ -248,10 +252,6 @@ namespace MWWorld mLocalScripts.clear(); mPlayer->clear(); - // enable collision - if (!mPhysics->toggleCollisionMode()) - mPhysics->toggleCollisionMode(); - mWorldScene->changeToVoid(); mStore.clearDynamic();