|
|
@ -436,6 +436,7 @@ namespace MWWorld
|
|
|
|
mLevitationEnabled = true;
|
|
|
|
mLevitationEnabled = true;
|
|
|
|
mPlayerTraveling = false;
|
|
|
|
mPlayerTraveling = false;
|
|
|
|
mPlayerInJail = false;
|
|
|
|
mPlayerInJail = false;
|
|
|
|
|
|
|
|
mIdsRebuilt = false;
|
|
|
|
|
|
|
|
|
|
|
|
fillGlobalVariables();
|
|
|
|
fillGlobalVariables();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -507,11 +508,11 @@ namespace MWWorld
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ESM::REC_PLAY:
|
|
|
|
case ESM::REC_PLAY:
|
|
|
|
// World::write always puts `ESM::REC_PLAY` between ESMStore (that contains dynamic records)
|
|
|
|
if (reader.getFormatVersion() <= ESM::MaxPlayerBeforeCellDataFormatVersion && !mIdsRebuilt)
|
|
|
|
// and WorldModel (that can contain instances of dynamic records). Here we need to rebuild
|
|
|
|
{
|
|
|
|
// ESMStore index in order to be able to lookup dynamic records while loading the player and
|
|
|
|
mStore.rebuildIdsIndex();
|
|
|
|
// WorldModel.
|
|
|
|
mIdsRebuilt = true;
|
|
|
|
mStore.rebuildIdsIndex();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mStore.checkPlayer();
|
|
|
|
mStore.checkPlayer();
|
|
|
|
mPlayer->readRecord(reader, type);
|
|
|
|
mPlayer->readRecord(reader, type);
|
|
|
@ -523,10 +524,19 @@ namespace MWWorld
|
|
|
|
mWorldScene->preloadCellWithSurroundings(*getPlayerPtr().getCell());
|
|
|
|
mWorldScene->preloadCellWithSurroundings(*getPlayerPtr().getCell());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ESM::REC_CSTA:
|
|
|
|
|
|
|
|
// We need to rebuild the ESMStore index in order to be able to lookup dynamic records while loading the
|
|
|
|
|
|
|
|
// WorldModel and, afterwards, the player.
|
|
|
|
|
|
|
|
if (!mIdsRebuilt)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mStore.rebuildIdsIndex();
|
|
|
|
|
|
|
|
mIdsRebuilt = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mWorldModel.readRecord(reader, type);
|
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
if (!mStore.readRecord(reader, type) && !mGlobalVariables.readRecord(reader, type)
|
|
|
|
if (!mStore.readRecord(reader, type) && !mGlobalVariables.readRecord(reader, type)
|
|
|
|
&& !mWeatherManager->readRecord(reader, type) && !mWorldModel.readRecord(reader, type)
|
|
|
|
&& !mWeatherManager->readRecord(reader, type) && !mProjectileManager->readRecord(reader, type))
|
|
|
|
&& !mProjectileManager->readRecord(reader, type))
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw std::runtime_error("unknown record in saved game");
|
|
|
|
throw std::runtime_error("unknown record in saved game");
|
|
|
|
}
|
|
|
|
}
|
|
|
|