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:
parent
e3670cff8a
commit
55544e931c
@ -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
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user