Working shift-click support in crafting areas; window update working in 1.3.2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@869 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
@@ -294,6 +294,35 @@ void cWindow::DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, cSlotArea
|
||||
|
||||
|
||||
|
||||
void cWindow::SendSlot(cPlayer & a_Player, cSlotArea * a_SlotArea, int a_RelativeSlotNum)
|
||||
{
|
||||
int SlotBase = 0;
|
||||
bool Found = false;
|
||||
for (cSlotAreas::iterator itr = m_SlotAreas.begin(), end = m_SlotAreas.end(); itr != end; ++itr)
|
||||
{
|
||||
if (*itr == a_SlotArea)
|
||||
{
|
||||
Found = true;
|
||||
break;
|
||||
}
|
||||
SlotBase += (*itr)->GetNumSlots();
|
||||
} // for itr - m_SlotAreas[]
|
||||
if (!Found)
|
||||
{
|
||||
LOGERROR("cWindow::SendSlot(): unknown a_SlotArea");
|
||||
ASSERT(!"cWindow::SendSlot(): unknown a_SlotArea");
|
||||
return;
|
||||
}
|
||||
|
||||
a_Player.GetClientHandle()->SendInventorySlot(
|
||||
m_WindowID, a_RelativeSlotNum + SlotBase, *(a_SlotArea->GetSlot(a_RelativeSlotNum, a_Player))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cWindow::Destroy(void)
|
||||
{
|
||||
LOGD("Destroying window %p (type %d)", this, m_WindowType);
|
||||
|
||||
Reference in New Issue
Block a user