1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-03 17:37:18 +00:00

Don't allow saves with an invalid last generated RefNum to load

This commit is contained in:
Evil Eye 2023-07-15 16:26:28 +02:00
parent ce84fdf5f5
commit 44ab0ff8ef
2 changed files with 5 additions and 1 deletions

View File

@ -52,6 +52,7 @@
Bug #7092: BSA archives from higher priority directories don't take priority
Bug #7122: Teleportation to underwater should cancel active water walking effect
Bug #7131: MyGUI log spam when post processing HUD is open
Bug #7134: Saves with an invalid last generated RefNum can be loaded
Bug #7163: Myar Aranath: Wheat breaks the GUI
Bug #7172: Current music playlist continues playing indefinitely if next playlist is empty
Bug #7229: Error marker loading failure is not handled

View File

@ -81,7 +81,10 @@ namespace MWLua
void WorldView::load(ESM::ESMReader& esm)
{
esm.getHNT(mSimulationTime, "LUAW");
MWBase::Environment::get().getWorldModel()->setLastGeneratedRefNum(esm.getFormId(true));
ESM::FormId lastGenerated = esm.getFormId(true);
if (lastGenerated.hasContentFile())
throw std::runtime_error("Last generated RefNum is invalid");
MWBase::Environment::get().getWorldModel()->setLastGeneratedRefNum(lastGenerated);
}
void WorldView::save(ESM::ESMWriter& esm) const