summaryrefslogtreecommitdiffstats
path: root/source/cInventory.cpp
diff options
context:
space:
mode:
authorlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-01-01 19:45:28 +0100
committerlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-01-01 19:45:28 +0100
commitac63775297cffb56b05702c0a3c6575f1bcd7d3b (patch)
tree9a5355be1d74a613a71ca43e2b85d53688eb6de2 /source/cInventory.cpp
parentFixed the numchunks console command. (diff)
downloadcuberite-ac63775297cffb56b05702c0a3c6575f1bcd7d3b.tar
cuberite-ac63775297cffb56b05702c0a3c6575f1bcd7d3b.tar.gz
cuberite-ac63775297cffb56b05702c0a3c6575f1bcd7d3b.tar.bz2
cuberite-ac63775297cffb56b05702c0a3c6575f1bcd7d3b.tar.lz
cuberite-ac63775297cffb56b05702c0a3c6575f1bcd7d3b.tar.xz
cuberite-ac63775297cffb56b05702c0a3c6575f1bcd7d3b.tar.zst
cuberite-ac63775297cffb56b05702c0a3c6575f1bcd7d3b.zip
Diffstat (limited to 'source/cInventory.cpp')
-rw-r--r--source/cInventory.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/cInventory.cpp b/source/cInventory.cpp
index 9236a2387..166ef6ad5 100644
--- a/source/cInventory.cpp
+++ b/source/cInventory.cpp
@@ -18,6 +18,8 @@ cInventory::~cInventory()
{
delete [] m_Slots;
delete m_EquippedItem;
+ if( GetWindow() ) GetWindow()->Close( *m_Owner );
+ CloseWindow();
}
cInventory::cInventory(cPlayer* a_Owner)
@@ -35,6 +37,14 @@ cInventory::cInventory(cPlayer* a_Owner)
m_EquippedItem = new cItem();
m_EquippedSlot = 0;
+
+ if( !GetWindow() )
+ {
+ cWindow* Window = new cWindow( this, false );
+ Window->SetSlots( m_Slots, c_NumSlots );
+ Window->SetWindowID( 0 );
+ OpenWindow( Window );
+ }
}
bool cInventory::AddItem( cItem & a_Item )