1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-19 05:39:41 +00:00

Refuse loading save games of unknown format

(cherry picked from commit 20d03c7e39)
This commit is contained in:
scrawl 2015-06-30 17:26:42 +02:00 committed by cc9cii
parent 05fd4e123e
commit 65bd5d8492
2 changed files with 3 additions and 5 deletions

View file

@ -28,9 +28,6 @@ void MWState::Character::addSlot (const boost::filesystem::path& path, const std
ESM::ESMReader reader;
reader.open (slot.mPath.string());
if (reader.getFormat()>ESM::Header::CurrentFormat)
return; // format is too new -> ignore
if (reader.getRecName()!=ESM::REC_SAVE)
return; // invalid save file -> ignore

View file

@ -310,8 +310,6 @@ void MWState::StateManager::loadGame(const std::string& filepath)
// have to peek into the save file to get the player name
ESM::ESMReader reader;
reader.open (filepath);
if (reader.getFormat()>ESM::Header::CurrentFormat)
return; // format is too new -> ignore
if (reader.getRecName()!=ESM::REC_SAVE)
return; // invalid save file -> ignore
reader.getRecHeader();
@ -333,6 +331,9 @@ void MWState::StateManager::loadGame (const Character *character, const std::str
ESM::ESMReader reader;
reader.open (filepath);
if (reader.getFormat() > ESM::SavedGame::sCurrentFormat)
throw std::runtime_error("This save file was created using a newer version of OpenMW and is thus not supported. Please upgrade to the newest OpenMW version to load this file.");
std::map<int, int> contentFileMap = buildContentFileIndexMap (reader);
Loading::Listener& listener = *MWBase::Environment::get().getWindowManager()->getLoadingScreen();