Advertisement
Guest User

Untitled

a guest
Dec 25th, 2011
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. Index: source/cPlayer.cpp
  2. ===================================================================
  3. --- source/cPlayer.cpp (revision 102)
  4. +++ source/cPlayer.cpp (working copy)
  5. @@ -108,7 +108,7 @@
  6. SaveToDisk();
  7. m_ClientHandle = 0;
  8.  
  9. - CloseWindow();
  10. + CloseWindow(-1);
  11. if( m_Inventory )
  12. {
  13. delete m_Inventory;
  14. @@ -399,14 +399,21 @@
  15.  
  16. void cPlayer::OpenWindow( cWindow* a_Window )
  17. {
  18. - CloseWindow();
  19. + CloseWindow(m_CurrentWindow ? (char)m_CurrentWindow->GetWindowType() : 0);
  20. a_Window->Open( *this );
  21. m_CurrentWindow = a_Window;
  22. }
  23.  
  24. -void cPlayer::CloseWindow()
  25. +void cPlayer::CloseWindow(char wID = -1)
  26. {
  27. if( m_CurrentWindow ) m_CurrentWindow->Close( *this );
  28. + if (wID == 0) {
  29. + if(GetInventory().GetWindow()->GetDraggingItem() && GetInventory().GetWindow()->GetDraggingItem()->m_ItemCount > 0)
  30. + {
  31. + LOG("Player holds item! Dropping it...");
  32. + TossItem( true, GetInventory().GetWindow()->GetDraggingItem()->m_ItemCount );
  33. + }
  34. + }
  35. m_CurrentWindow = 0;
  36. }
  37.  
  38. Index: source/cPlayer.h
  39. ===================================================================
  40. --- source/cPlayer.h (revision 102)
  41. +++ source/cPlayer.h (working copy)
  42. @@ -46,7 +46,7 @@
  43.  
  44. cWindow* GetWindow() { return m_CurrentWindow; }
  45. void OpenWindow( cWindow* a_Window );
  46. - void CloseWindow();
  47. + void CloseWindow(char wID);
  48.  
  49. cClientHandle* GetClientHandle() { return m_ClientHandle; } //tolua_export
  50. void SetClientHandle( cClientHandle* a_Client ) { m_ClientHandle = a_Client; }
  51. Index: source/cWindow.cpp
  52. ===================================================================
  53. --- source/cWindow.cpp (revision 102)
  54. +++ source/cWindow.cpp (working copy)
  55. @@ -224,9 +224,9 @@
  56. m_Owner = 0;
  57. while( m_OpenedBy.size() > 1 )
  58. {
  59. - (*m_OpenedBy.begin() )->CloseWindow();
  60. + (*m_OpenedBy.begin() )->CloseWindow((char)GetWindowType());
  61. }
  62. - (*m_OpenedBy.begin() )->CloseWindow();
  63. + (*m_OpenedBy.begin() )->CloseWindow((char)GetWindowType());
  64. }
  65.  
  66. void cWindow::Destroy()
  67. Index: source/cClientHandle.cpp
  68. ===================================================================
  69. --- source/cClientHandle.cpp (revision 102)
  70. +++ source/cClientHandle.cpp (working copy)
  71. @@ -1082,10 +1082,13 @@
  72. case E_WINDOW_CLOSE:
  73. {
  74. cPacket_WindowClose* PacketData = reinterpret_cast<cPacket_WindowClose*>(a_Packet);
  75. + m_Player->CloseWindow(PacketData->m_Close);
  76. + /*
  77. if( PacketData->m_Close > 0 ) // Don't care about closing inventory
  78. {
  79. m_Player->CloseWindow();
  80. }
  81. + */
  82. }
  83. break;
  84. case E_WINDOW_CLICK:
  85. @@ -1163,7 +1166,7 @@
  86. cAuthenticator Authenticator;
  87. if( !Authenticator.Authenticate( self->GetUsername(), cRoot::Get()->GetServer()->GetServerID() ) )
  88. {
  89. - self->Kick("You could not be authenticated, sorry buddy!");
  90. + self->Kick("Failed to verify username!");
  91. return;
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement