From b7b7c0612dd1f50d1705448fc8c2b79b78dcbdae Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 13 Mar 2016 23:48:44 +0100 Subject: [PATCH] Make getCurrentCharacter create argument explicit --- apps/openmw/mwstate/statemanagerimp.cpp | 12 ++++++------ apps/openmw/mwstate/statemanagerimp.hpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwstate/statemanagerimp.cpp b/apps/openmw/mwstate/statemanagerimp.cpp index 8f0b3b74b1..115b47a5d9 100644 --- a/apps/openmw/mwstate/statemanagerimp.cpp +++ b/apps/openmw/mwstate/statemanagerimp.cpp @@ -204,9 +204,9 @@ void MWState::StateManager::saveGame (const std::string& description, const Slot writeScreenshot(profile.mScreenshot); if (!slot) - slot = getCurrentCharacter()->createSlot (profile); + slot = getCurrentCharacter(true)->createSlot (profile); else - slot = getCurrentCharacter()->updateSlot (slot, profile); + slot = getCurrentCharacter(true)->updateSlot (slot, profile); // Write to a memory stream first. If there is an exception during the save process, we don't want to trash the // existing save file we are overwriting. @@ -290,7 +290,7 @@ void MWState::StateManager::saveGame (const std::string& description, const Slot // If no file was written, clean up the slot if (slot && !boost::filesystem::exists(slot->mPath)) - getCurrentCharacter()->deleteSlot(slot); + getCurrentCharacter(true)->deleteSlot(slot); } } @@ -506,11 +506,11 @@ void MWState::StateManager::loadGame (const Character *character, const std::str void MWState::StateManager::quickLoad() { - if (Character* mCurrentCharacter = getCurrentCharacter (false)) + if (Character* currentCharacter = getCurrentCharacter (false)) { - if (mCurrentCharacter->begin() == mCurrentCharacter->end()) + if (currentCharacter->begin() == currentCharacter->end()) return; - loadGame (mCurrentCharacter, mCurrentCharacter->begin()->mPath.string()); //Get newest save + loadGame (currentCharacter, currentCharacter->begin()->mPath.string()); //Get newest save } } diff --git a/apps/openmw/mwstate/statemanagerimp.hpp b/apps/openmw/mwstate/statemanagerimp.hpp index 59dc919d14..44ee98be7f 100644 --- a/apps/openmw/mwstate/statemanagerimp.hpp +++ b/apps/openmw/mwstate/statemanagerimp.hpp @@ -73,7 +73,7 @@ namespace MWState virtual void loadGame (const Character *character, const std::string &filepath); ///< Load a saved game file belonging to the given character. - virtual Character *getCurrentCharacter (bool create = true); + virtual Character *getCurrentCharacter (bool create); ///< \param create Create a new character, if there is no current character. virtual CharacterIterator characterBegin();