1
0

Fixed personal crafting grid not being tossed on inventory close.

FS #355, http://www.mc-server.org/support/index.php?do=details&task_id=355

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1358 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2013-04-04 11:47:31 +00:00
parent fbacc1e1c4
commit 4aed49a70f
10 changed files with 22 additions and 36 deletions

View File

@@ -455,27 +455,8 @@ void cPlayer::OpenWindow( cWindow* a_Window )
void cPlayer::CloseWindow(char a_WindowType)
{
if (m_CurrentWindow == m_InventoryWindow)
{
// The inventory window must not be closed and must not be even sent a close packet
if (IsDraggingItem()) // But we need to check if player is holding anything
{
LOGD("Player holds item in inventory window! Dropping it...");
TossItem(true, GetDraggingItem().m_ItemCount);
}
return;
}
if (m_CurrentWindow != NULL)
{
// TODO: This code should be in cChestWindow instead
if ((a_WindowType == 1) && (m_CurrentWindow->GetWindowType() == cWindow::Chest))
{
int x, y, z;
m_CurrentWindow->GetOwner()->GetBlockPos(x, y, z);
m_World->BroadcastBlockAction(x, y, z, 1, 0, E_BLOCK_CHEST);
}
m_CurrentWindow->ClosedByPlayer(*this);
}
m_CurrentWindow = m_InventoryWindow;