summaryrefslogtreecommitdiffstats
path: root/source/packets/cPacket_WholeInventory.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-19 13:51:17 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-19 13:51:17 +0200
commiteb3ed1aec1fb9e4468a7829cabd42572b7554d70 (patch)
tree4b5f428bf612785af8c306ba40f46c66fe0681a0 /source/packets/cPacket_WholeInventory.cpp
parentFixed Bug #236 (diff)
downloadcuberite-eb3ed1aec1fb9e4468a7829cabd42572b7554d70.tar
cuberite-eb3ed1aec1fb9e4468a7829cabd42572b7554d70.tar.gz
cuberite-eb3ed1aec1fb9e4468a7829cabd42572b7554d70.tar.bz2
cuberite-eb3ed1aec1fb9e4468a7829cabd42572b7554d70.tar.lz
cuberite-eb3ed1aec1fb9e4468a7829cabd42572b7554d70.tar.xz
cuberite-eb3ed1aec1fb9e4468a7829cabd42572b7554d70.tar.zst
cuberite-eb3ed1aec1fb9e4468a7829cabd42572b7554d70.zip
Diffstat (limited to '')
-rw-r--r--source/packets/cPacket_WholeInventory.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/source/packets/cPacket_WholeInventory.cpp b/source/packets/cPacket_WholeInventory.cpp
index fd6a6b457..69ea33580 100644
--- a/source/packets/cPacket_WholeInventory.cpp
+++ b/source/packets/cPacket_WholeInventory.cpp
@@ -25,28 +25,28 @@ cPacket_WholeInventory::cPacket_WholeInventory( const cPacket_WholeInventory & a
-cPacket_WholeInventory::cPacket_WholeInventory(cInventory * a_Inventory)
+cPacket_WholeInventory::cPacket_WholeInventory(const cInventory & a_Inventory)
{
m_PacketID = E_INVENTORY_WHOLE;
- m_WindowID = 0;
- m_Count = a_Inventory->c_NumSlots;
- m_Items = new cItem[m_Count];
+ m_WindowID = 0; // Inventory window has a constant ID of 0
+ m_Count = a_Inventory.c_NumSlots;
+ m_Items = new cItem[m_Count];
// TODO: copy items one by one, they may have some values that needn't be shallow-copiable
- memcpy( m_Items, a_Inventory->GetSlots(), sizeof(cItem)*m_Count );
+ memcpy( m_Items, a_Inventory.GetSlots(), sizeof(cItem) * m_Count);
}
-cPacket_WholeInventory::cPacket_WholeInventory(cWindow * a_Window)
+cPacket_WholeInventory::cPacket_WholeInventory(const cWindow & a_Window)
{
m_PacketID = E_INVENTORY_WHOLE;
- m_WindowID = (char)a_Window->GetWindowID();
- m_Count = (short)a_Window->GetNumSlots();
- m_Items = new cItem[m_Count];
+ m_WindowID = (char)a_Window.GetWindowID();
+ m_Count = (short)a_Window.GetNumSlots();
+ m_Items = new cItem[m_Count];
// TODO: copy items one by one, they may have some values that needn't be shallow-copiable
- memcpy( m_Items, a_Window->GetSlots(), sizeof(cItem) * m_Count);
+ memcpy( m_Items, a_Window.GetSlots(), sizeof(cItem) * m_Count);
}