From 530be5bd6603b4c59deb5f44ca96b1ee000acb02 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 24 Aug 2012 08:04:58 +0000 Subject: Inventory doesn't use cPackets git-svn-id: http://mc-server.googlecode.com/svn/trunk@784 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cInventory.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'source') diff --git a/source/cInventory.cpp b/source/cInventory.cpp index cd74cad41..58165ff09 100644 --- a/source/cInventory.cpp +++ b/source/cInventory.cpp @@ -10,10 +10,6 @@ #include -#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); } } -- cgit v1.2.3