mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 18:09:39 +00:00
Add fail-safes to DedicatedPlayer cell updating to narrow down problems
This commit is contained in:
parent
e39b66af4f
commit
1bbd7c271f
1 changed files with 8 additions and 1 deletions
|
@ -406,13 +406,20 @@ void DedicatedPlayer::UpdateDrawState()
|
||||||
|
|
||||||
void DedicatedPlayer::updateCell()
|
void DedicatedPlayer::updateCell()
|
||||||
{
|
{
|
||||||
|
// Prevent cell update when player hasn't been instantiated yet
|
||||||
|
if (state == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
MWWorld::CellStore *cellStore;
|
MWWorld::CellStore *cellStore;
|
||||||
|
|
||||||
if (cell.isExterior() == 1)
|
if (cell.isExterior() == 1)
|
||||||
cellStore = world->getExterior(cell.mCellId.mIndex.mX, cell.mCellId.mIndex.mY);
|
cellStore = world->getExterior(cell.mCellId.mIndex.mX, cell.mCellId.mIndex.mY);
|
||||||
else
|
else if (!cell.mName.empty())
|
||||||
cellStore = world->getInterior(cell.mName);
|
cellStore = world->getInterior(cell.mName);
|
||||||
|
// Go no further if cell data is invalid
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
// tes3mp debug start
|
// tes3mp debug start
|
||||||
printf("Server says %s (%s) moved to %s\n",
|
printf("Server says %s (%s) moved to %s\n",
|
||||||
|
|
Loading…
Reference in a new issue