From bf2f932e1865e94c98466e098b1724193082f7d7 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Tue, 21 Feb 2017 01:01:30 +0200 Subject: [PATCH] [Client] If in a container, don't crash when teleported to another cell --- apps/openmw/mwmp/LocalPlayer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 880dc232b..013ac0d8b 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -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;