1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 18:19:55 +00:00

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

This commit is contained in:
scrawl 2015-01-11 20:07:17 +01:00
parent c3f3f8b3d0
commit 82eaa9f1bc
2 changed files with 9 additions and 8 deletions

View file

@ -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();

View file

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