1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-05 06:40:09 +00:00

Make getCurrentCharacter create argument explicit

This commit is contained in:
scrawl 2016-03-13 23:48:44 +01:00
parent 7463c0c353
commit b7b7c0612d
2 changed files with 7 additions and 7 deletions

View File

@ -204,9 +204,9 @@ void MWState::StateManager::saveGame (const std::string& description, const Slot
writeScreenshot(profile.mScreenshot); writeScreenshot(profile.mScreenshot);
if (!slot) if (!slot)
slot = getCurrentCharacter()->createSlot (profile); slot = getCurrentCharacter(true)->createSlot (profile);
else 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 // 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. // 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 no file was written, clean up the slot
if (slot && !boost::filesystem::exists(slot->mPath)) 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() 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; return;
loadGame (mCurrentCharacter, mCurrentCharacter->begin()->mPath.string()); //Get newest save loadGame (currentCharacter, currentCharacter->begin()->mPath.string()); //Get newest save
} }
} }

View File

@ -73,7 +73,7 @@ namespace MWState
virtual void loadGame (const Character *character, const std::string &filepath); virtual void loadGame (const Character *character, const std::string &filepath);
///< Load a saved game file belonging to the given character. ///< 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. ///< \param create Create a new character, if there is no current character.
virtual CharacterIterator characterBegin(); virtual CharacterIterator characterBegin();