summaryrefslogtreecommitdiffstats
path: root/source/UI
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-04 13:47:31 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-04 13:47:31 +0200
commit4aed49a70fe2e4fa3600b31525766c52bff52e3d (patch)
treed17c4a960f4fea8c4020c0b5b6eba1d951fe25da /source/UI
parentFixed CreateHexDump() filling the string with garbage (diff)
downloadcuberite-4aed49a70fe2e4fa3600b31525766c52bff52e3d.tar
cuberite-4aed49a70fe2e4fa3600b31525766c52bff52e3d.tar.gz
cuberite-4aed49a70fe2e4fa3600b31525766c52bff52e3d.tar.bz2
cuberite-4aed49a70fe2e4fa3600b31525766c52bff52e3d.tar.lz
cuberite-4aed49a70fe2e4fa3600b31525766c52bff52e3d.tar.xz
cuberite-4aed49a70fe2e4fa3600b31525766c52bff52e3d.tar.zst
cuberite-4aed49a70fe2e4fa3600b31525766c52bff52e3d.zip
Diffstat (limited to '')
-rw-r--r--source/UI/Window.cpp7
-rw-r--r--source/UI/Window.h2
2 files changed, 4 insertions, 5 deletions
diff --git a/source/UI/Window.cpp b/source/UI/Window.cpp
index d22255105..12c3e7350 100644
--- a/source/UI/Window.cpp
+++ b/source/UI/Window.cpp
@@ -165,8 +165,6 @@ void cWindow::OpenedByPlayer(cPlayer & a_Player)
void cWindow::ClosedByPlayer(cPlayer & a_Player)
{
- ASSERT(m_WindowType != Inventory); // Inventory windows must not be closed (the client would repeat the close packet, looping forever)
-
// Checks whether the player is still holding an item
if (a_Player.IsDraggingItem())
{
@@ -177,7 +175,7 @@ void cWindow::ClosedByPlayer(cPlayer & a_Player)
cClientHandle * ClientHandle = a_Player.GetClientHandle();
if (ClientHandle != NULL)
{
- ClientHandle->SendWindowClose(m_WindowID);
+ ClientHandle->SendWindowClose(*this);
}
{
@@ -189,7 +187,8 @@ void cWindow::ClosedByPlayer(cPlayer & a_Player)
} // for itr - m_SlotAreas[]
m_OpenedBy.remove(&a_Player);
- if (m_OpenedBy.empty())
+
+ if ((m_WindowType != Inventory) && m_OpenedBy.empty())
{
Destroy();
}
diff --git a/source/UI/Window.h b/source/UI/Window.h
index 1c5fe4084..c119d79ab 100644
--- a/source/UI/Window.h
+++ b/source/UI/Window.h
@@ -62,7 +62,7 @@ public:
char GetWindowID(void) const { return m_WindowID; }
int GetWindowType(void) const { return m_WindowType; }
- cWindowOwner * GetOwner() { return m_Owner; }
+ cWindowOwner * GetOwner(void) { return m_Owner; }
void SetOwner( cWindowOwner * a_Owner ) { m_Owner = a_Owner; }
int GetNumSlots(void) const;