summaryrefslogtreecommitdiffstats
path: root/src/UI
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2018-01-28 18:24:59 +0100
committerGitHub <noreply@github.com>2018-01-28 18:24:59 +0100
commitf0c735e8466fbb52bb805dd839f5e4fd37d59af8 (patch)
treeb7d3748f429bcb9c969cb8d0ea5373f8fc098191 /src/UI
parentcClientHandle: Always call HOOK_PLAYER_RIGHT_CLICK (#4149) (diff)
downloadcuberite-f0c735e8466fbb52bb805dd839f5e4fd37d59af8.tar
cuberite-f0c735e8466fbb52bb805dd839f5e4fd37d59af8.tar.gz
cuberite-f0c735e8466fbb52bb805dd839f5e4fd37d59af8.tar.bz2
cuberite-f0c735e8466fbb52bb805dd839f5e4fd37d59af8.tar.lz
cuberite-f0c735e8466fbb52bb805dd839f5e4fd37d59af8.tar.xz
cuberite-f0c735e8466fbb52bb805dd839f5e4fd37d59af8.tar.zst
cuberite-f0c735e8466fbb52bb805dd839f5e4fd37d59af8.zip
Diffstat (limited to 'src/UI')
-rw-r--r--src/UI/Window.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/UI/Window.cpp b/src/UI/Window.cpp
index 629db12c2..92e69e8b7 100644
--- a/src/UI/Window.cpp
+++ b/src/UI/Window.cpp
@@ -328,11 +328,13 @@ bool cWindow::ClosedByPlayer(cPlayer & a_Player, bool a_CanRefuse)
(*itr)->OnPlayerRemoved(a_Player);
} // for itr - m_SlotAreas[]
- m_OpenedBy.remove(&a_Player);
-
- if ((m_WindowType != wtInventory) && m_OpenedBy.empty())
+ if (m_WindowType != wtInventory)
{
- Destroy();
+ m_OpenedBy.remove(&a_Player);
+ if (m_OpenedBy.empty())
+ {
+ Destroy();
+ }
}
}
if (m_IsDestroyed)