diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-06 22:10:16 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-08-06 22:10:16 +0200 |
commit | e8366993ce3f1cc0c2c6cde1d133773d1f23c474 (patch) | |
tree | 789fd452065ff6aa68f2ceac5664959bdb24afc0 /source/cWindow.cpp | |
parent | Added the Doxygen configuration file (diff) | |
download | cuberite-e8366993ce3f1cc0c2c6cde1d133773d1f23c474.tar cuberite-e8366993ce3f1cc0c2c6cde1d133773d1f23c474.tar.gz cuberite-e8366993ce3f1cc0c2c6cde1d133773d1f23c474.tar.bz2 cuberite-e8366993ce3f1cc0c2c6cde1d133773d1f23c474.tar.lz cuberite-e8366993ce3f1cc0c2c6cde1d133773d1f23c474.tar.xz cuberite-e8366993ce3f1cc0c2c6cde1d133773d1f23c474.tar.zst cuberite-e8366993ce3f1cc0c2c6cde1d133773d1f23c474.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cWindow.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/source/cWindow.cpp b/source/cWindow.cpp index fe029cfd9..f2c66420e 100644 --- a/source/cWindow.cpp +++ b/source/cWindow.cpp @@ -18,9 +18,9 @@ -cWindow::cWindow( cWindowOwner* a_Owner, bool a_bInventoryVisible ) - : m_WindowID( 0 ) - , m_WindowType( 0 ) +cWindow::cWindow( cWindowOwner* a_Owner, bool a_bInventoryVisible, cWindow::WindowType a_WindowType, int a_WindowID) + : m_WindowID( a_WindowID ) + , m_WindowType( a_WindowType ) , m_Owner( a_Owner ) , m_bInventoryVisible( a_bInventoryVisible ) , m_NumSlots( 0 ) @@ -28,8 +28,11 @@ cWindow::cWindow( cWindowOwner* a_Owner, bool a_bInventoryVisible ) , m_DraggingItem( 0 ) , m_IsDestroyed(false) { - LOGD("Created a window at %p", this); - if( !m_bInventoryVisible ) m_DraggingItem = new cItem(); + LOGD("Created a window at %p, type = %d, ID = %i", this, a_WindowType, a_WindowID); + if (!m_bInventoryVisible) + { + m_DraggingItem = new cItem(); + } } @@ -234,18 +237,18 @@ void cWindow::Open( cPlayer & a_Player ) void cWindow::Close( cPlayer & a_Player ) { //Checks wheather the player is still holding an item - if(m_DraggingItem && m_DraggingItem->m_ItemCount > 0) + if (m_DraggingItem && m_DraggingItem->m_ItemCount > 0) { - LOG("Player holds item! Dropping it..."); - a_Player.TossItem( true, m_DraggingItem->m_ItemCount ); + LOGD("Player holds item! Dropping it..."); + a_Player.TossItem(true, m_DraggingItem->m_ItemCount); } cPacket_WindowClose WindowClose; WindowClose.m_Close = (char)m_WindowID; cClientHandle * ClientHandle = a_Player.GetClientHandle(); - if ( ClientHandle != NULL) + if (ClientHandle != NULL) { - ClientHandle->Send( WindowClose ); + ClientHandle->Send(WindowClose); } { |