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

revert-6246b479
Evil Eye 10 months ago
parent ce84fdf5f5
commit 44ab0ff8ef

@ -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

@ -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

Loading…
Cancel
Save