mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 13:15:32 +00:00
Refuse loading save games of unknown format
This commit is contained in:
parent
a081d402c5
commit
20d03c7e39
2 changed files with 3 additions and 5 deletions
|
@ -29,9 +29,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
|
||||
|
||||
|
|
|
@ -325,8 +325,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();
|
||||
|
@ -348,6 +346,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