|
|
|
@ -302,7 +302,8 @@ namespace MWWorld
|
|
|
|
|
+mProjectileManager->countSavedGameRecords()
|
|
|
|
|
+1 // player record
|
|
|
|
|
+1 // weather record
|
|
|
|
|
+1; // actorId counter
|
|
|
|
|
+1 // actorId counter
|
|
|
|
|
+1; // levitation/teleport enabled state
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void World::write (ESM::ESMWriter& writer, Loading::Listener& progress) const
|
|
|
|
@ -325,25 +326,37 @@ namespace MWWorld
|
|
|
|
|
mPlayer->write (writer, progress);
|
|
|
|
|
mWeatherManager->write (writer, progress);
|
|
|
|
|
mProjectileManager->write (writer, progress);
|
|
|
|
|
|
|
|
|
|
writer.startRecord(ESM::REC_ENAB);
|
|
|
|
|
writer.writeHNT("TELE", mTeleportEnabled);
|
|
|
|
|
writer.writeHNT("LEVT", mLevitationEnabled);
|
|
|
|
|
writer.endRecord(ESM::REC_ENAB);
|
|
|
|
|
progress.increaseProgress();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void World::readRecord (ESM::ESMReader& reader, int32_t type,
|
|
|
|
|
const std::map<int, int>& contentFileMap)
|
|
|
|
|
{
|
|
|
|
|
if (type == ESM::REC_ACTC)
|
|
|
|
|
{
|
|
|
|
|
MWMechanics::CreatureStats::readActorIdCounter(reader);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!mStore.readRecord (reader, type) &&
|
|
|
|
|
!mGlobalVariables.readRecord (reader, type) &&
|
|
|
|
|
!mPlayer->readRecord (reader, type) &&
|
|
|
|
|
!mWeatherManager->readRecord (reader, type) &&
|
|
|
|
|
!mCells.readRecord (reader, type, contentFileMap) &&
|
|
|
|
|
!mProjectileManager->readRecord (reader, type))
|
|
|
|
|
switch (type)
|
|
|
|
|
{
|
|
|
|
|
throw std::runtime_error ("unknown record in saved game");
|
|
|
|
|
case ESM::REC_ACTC:
|
|
|
|
|
MWMechanics::CreatureStats::readActorIdCounter(reader);
|
|
|
|
|
return;
|
|
|
|
|
case ESM::REC_ENAB:
|
|
|
|
|
reader.getHNT(mTeleportEnabled, "TELE");
|
|
|
|
|
reader.getHNT(mLevitationEnabled, "LEVT");
|
|
|
|
|
return;
|
|
|
|
|
default:
|
|
|
|
|
if (!mStore.readRecord (reader, type) &&
|
|
|
|
|
!mGlobalVariables.readRecord (reader, type) &&
|
|
|
|
|
!mPlayer->readRecord (reader, type) &&
|
|
|
|
|
!mWeatherManager->readRecord (reader, type) &&
|
|
|
|
|
!mCells.readRecord (reader, type, contentFileMap) &&
|
|
|
|
|
!mProjectileManager->readRecord (reader, type))
|
|
|
|
|
{
|
|
|
|
|
throw std::runtime_error ("unknown record in saved game");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|