1
0
Fork 0

Inventory doesn't use cPackets

git-svn-id: http://mc-server.googlecode.com/svn/trunk@784 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2012-08-24 08:04:58 +00:00
parent e92b9e7ecb
commit 530be5bd66
1 changed files with 3 additions and 12 deletions

View File

@ -10,10 +10,6 @@
#include <json/json.h>
#include "packets/cPacket_WindowClick.h"
#include "packets/cPacket_WholeInventory.h"
#include "packets/cPacket_InventorySlot.h"
#include "items/Item.h"
@ -299,22 +295,17 @@ void cInventory::SendWholeInventoryToAll(void)
void cInventory::SendSlot( int a_SlotNum )
void cInventory::SendSlot(int a_SlotNum)
{
cItem * Item = GetSlot(a_SlotNum);
if (Item != NULL)
{
if (Item->IsEmpty())
{
// Sanitize items that are not completely empty (ie. count == 0, but type != empty)
Item->Empty();
}
cPacket_InventorySlot InventorySlot;
InventorySlot.m_ItemCount = Item->m_ItemCount;
InventorySlot.m_ItemID = (short) Item->m_ItemID;
InventorySlot.m_ItemUses = (char) Item->m_ItemHealth;
InventorySlot.m_SlotNum = (short) a_SlotNum;
InventorySlot.m_WindowID = 0; // Inventory window ID
m_Owner->GetClientHandle()->Send( InventorySlot );
m_Owner->GetClientHandle()->SendInventorySlot(0, a_SlotNum, *Item);
}
}