forked from teamnwah/openmw-tes3coop
Move createCharacter inside the try block
This commit is contained in:
parent
a0cc9de088
commit
50acdf3e47
1 changed files with 10 additions and 9 deletions
|
@ -174,6 +174,9 @@ void MWState::StateManager::endGame()
|
|||
void MWState::StateManager::saveGame (const std::string& description, const Slot *slot)
|
||||
{
|
||||
MWState::Character* character = getCurrentCharacter();
|
||||
|
||||
try
|
||||
{
|
||||
if (!character)
|
||||
{
|
||||
MWWorld::ConstPtr player = MWMechanics::getPlayer();
|
||||
|
@ -183,8 +186,6 @@ void MWState::StateManager::saveGame (const std::string& description, const Slot
|
|||
mCharacterManager.setCurrentCharacter(character);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
ESM::SavedGame profile;
|
||||
|
||||
MWBase::World& world = *MWBase::Environment::get().getWorld();
|
||||
|
@ -299,7 +300,7 @@ void MWState::StateManager::saveGame (const std::string& description, const Slot
|
|||
MWBase::Environment::get().getWindowManager()->interactiveMessageBox(error.str(), buttons);
|
||||
|
||||
// If no file was written, clean up the slot
|
||||
if (slot && !boost::filesystem::exists(slot->mPath))
|
||||
if (character && slot && !boost::filesystem::exists(slot->mPath))
|
||||
{
|
||||
character->deleteSlot(slot);
|
||||
character->cleanup();
|
||||
|
|
Loading…
Reference in a new issue