[Client] If in a container, don't crash when teleported to another cell

pull/163/head
David Cernat 8 years ago
parent f5470e0b49
commit bf2f932e18

@ -798,6 +798,12 @@ void LocalPlayer::setCell()
MWWorld::Ptr player = world->getPlayerPtr();
ESM::Position pos;
// To avoid crashes, close any container menus this player may be in
if (MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_Container))
{
MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Container);
}
world->getPlayer().setTeleported(true);
int x = cell.mData.mX;

Loading…
Cancel
Save