1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-18 13:12:50 +00:00

reject newer formats when scanning saved games

This commit is contained in:
Marc Zinnschlag 2013-11-25 10:21:49 +01:00
parent e3670cff8a
commit 55544e931c
2 changed files with 4 additions and 1 deletions

View File

@ -27,6 +27,9 @@ void MWState::Character::addSlot (const boost::filesystem::path& path)
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

@ -107,7 +107,7 @@ void MWState::StateManager::saveGame (const std::string& description, const Slot
std::ofstream stream (slot->mPath.string().c_str());
ESM::ESMWriter writer;
// writer.setFormat ();
writer.setFormat (ESM::Header::CurrentFormat);
writer.save (stream);
writer.startRecord ("SAVE");
slot->mProfile.save (writer);