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:
parent
05fd4e123e
commit
65bd5d8492
2 changed files with 3 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue