mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 21:49:55 +00:00
Fix loading crash (don't apply viewmode before player is set up) (Fixes #2272)
This commit is contained in:
parent
c3f3f8b3d0
commit
82eaa9f1bc
2 changed files with 9 additions and 8 deletions
|
@ -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…
Reference in a new issue