Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: source/cPlayer.cpp
- ===================================================================
- --- source/cPlayer.cpp (revision 102)
- +++ source/cPlayer.cpp (working copy)
- @@ -108,7 +108,7 @@
- SaveToDisk();
- m_ClientHandle = 0;
- - CloseWindow();
- + CloseWindow(-1);
- if( m_Inventory )
- {
- delete m_Inventory;
- @@ -399,14 +399,21 @@
- void cPlayer::OpenWindow( cWindow* a_Window )
- {
- - CloseWindow();
- + CloseWindow(m_CurrentWindow ? (char)m_CurrentWindow->GetWindowType() : 0);
- a_Window->Open( *this );
- m_CurrentWindow = a_Window;
- }
- -void cPlayer::CloseWindow()
- +void cPlayer::CloseWindow(char wID = -1)
- {
- if( m_CurrentWindow ) m_CurrentWindow->Close( *this );
- + if (wID == 0) {
- + if(GetInventory().GetWindow()->GetDraggingItem() && GetInventory().GetWindow()->GetDraggingItem()->m_ItemCount > 0)
- + {
- + LOG("Player holds item! Dropping it...");
- + TossItem( true, GetInventory().GetWindow()->GetDraggingItem()->m_ItemCount );
- + }
- + }
- m_CurrentWindow = 0;
- }
- Index: source/cPlayer.h
- ===================================================================
- --- source/cPlayer.h (revision 102)
- +++ source/cPlayer.h (working copy)
- @@ -46,7 +46,7 @@
- cWindow* GetWindow() { return m_CurrentWindow; }
- void OpenWindow( cWindow* a_Window );
- - void CloseWindow();
- + void CloseWindow(char wID);
- cClientHandle* GetClientHandle() { return m_ClientHandle; } //tolua_export
- void SetClientHandle( cClientHandle* a_Client ) { m_ClientHandle = a_Client; }
- Index: source/cWindow.cpp
- ===================================================================
- --- source/cWindow.cpp (revision 102)
- +++ source/cWindow.cpp (working copy)
- @@ -224,9 +224,9 @@
- m_Owner = 0;
- while( m_OpenedBy.size() > 1 )
- {
- - (*m_OpenedBy.begin() )->CloseWindow();
- + (*m_OpenedBy.begin() )->CloseWindow((char)GetWindowType());
- }
- - (*m_OpenedBy.begin() )->CloseWindow();
- + (*m_OpenedBy.begin() )->CloseWindow((char)GetWindowType());
- }
- void cWindow::Destroy()
- Index: source/cClientHandle.cpp
- ===================================================================
- --- source/cClientHandle.cpp (revision 102)
- +++ source/cClientHandle.cpp (working copy)
- @@ -1082,10 +1082,13 @@
- case E_WINDOW_CLOSE:
- {
- cPacket_WindowClose* PacketData = reinterpret_cast<cPacket_WindowClose*>(a_Packet);
- + m_Player->CloseWindow(PacketData->m_Close);
- + /*
- if( PacketData->m_Close > 0 ) // Don't care about closing inventory
- {
- m_Player->CloseWindow();
- }
- + */
- }
- break;
- case E_WINDOW_CLICK:
- @@ -1163,7 +1166,7 @@
- cAuthenticator Authenticator;
- if( !Authenticator.Authenticate( self->GetUsername(), cRoot::Get()->GetServer()->GetServerID() ) )
- {
- - self->Kick("You could not be authenticated, sorry buddy!");
- + self->Kick("Failed to verify username!");
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement