mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +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;
|
ESM::ESMReader reader;
|
||||||
reader.open (slot.mPath.string());
|
reader.open (slot.mPath.string());
|
||||||
|
|
||||||
|
if (reader.getFormat()>ESM::Header::CurrentFormat)
|
||||||
|
return; // format is too new -> ignore
|
||||||
|
|
||||||
if (reader.getRecName()!=ESM::REC_SAVE)
|
if (reader.getRecName()!=ESM::REC_SAVE)
|
||||||
return; // invalid save file -> ignore
|
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());
|
std::ofstream stream (slot->mPath.string().c_str());
|
||||||
ESM::ESMWriter writer;
|
ESM::ESMWriter writer;
|
||||||
// writer.setFormat ();
|
writer.setFormat (ESM::Header::CurrentFormat);
|
||||||
writer.save (stream);
|
writer.save (stream);
|
||||||
writer.startRecord ("SAVE");
|
writer.startRecord ("SAVE");
|
||||||
slot->mProfile.save (writer);
|
slot->mProfile.save (writer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user