Fix loading crash (don't apply viewmode before player is set up) (Fixes #2272)

openmw-35
scrawl 10 years ago
parent c3f3f8b3d0
commit 82eaa9f1bc

@ -342,6 +342,8 @@ void MWState::StateManager::loadGame (const Character *character, const std::str
Loading::ScopedLoad load(&listener);
bool firstPersonCam = false;
size_t total = reader.getFileSize();
int currentPercent = 0;
while (reader.hasMoreRecs())
@ -396,9 +398,11 @@ void MWState::StateManager::loadGame (const Character *character, const std::str
case ESM::REC_ENAB:
case ESM::REC_LEVC:
case ESM::REC_LEVI:
case ESM::REC_CAM_:
MWBase::Environment::get().getWorld()->readRecord(reader, n.val, contentFileMap);
break;
MWBase::Environment::get().getWorld()->readRecord (reader, n.val, contentFileMap);
case ESM::REC_CAM_:
reader.getHNT(firstPersonCam, "FIRS");
break;
case ESM::REC_GSCR:
@ -446,6 +450,9 @@ void MWState::StateManager::loadGame (const Character *character, const std::str
MWBase::Environment::get().getWindowManager()->updatePlayer();
MWBase::Environment::get().getMechanicsManager()->playerLoaded();
if (firstPersonCam != MWBase::Environment::get().getWorld()->isFirstPerson())
MWBase::Environment::get().getWorld()->togglePOV();
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPlayerPtr();
ESM::CellId cellId = ptr.getCell()->getCell()->getCellId();

@ -356,12 +356,6 @@ namespace MWWorld
reader.getHNT(mTeleportEnabled, "TELE");
reader.getHNT(mLevitationEnabled, "LEVT");
return;
case ESM::REC_CAM_:
bool firstperson;
reader.getHNT(firstperson, "FIRS");
if (firstperson != isFirstPerson())
togglePOV();
break;
default:
if (!mStore.readRecord (reader, type) &&
!mGlobalVariables.readRecord (reader, type) &&

Loading…
Cancel
Save