diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-09-21 22:50:34 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-09-21 22:50:34 +0200 |
commit | 50c6a660922410e9c010583f597ee3f011f43226 (patch) | |
tree | c3a53b70f7ff1d390d7469b739b2f4afaafa9f8f /source/Protocol132.cpp | |
parent | UI: Added shift-click support to most slot areas, except crafting. (diff) | |
download | cuberite-50c6a660922410e9c010583f597ee3f011f43226.tar cuberite-50c6a660922410e9c010583f597ee3f011f43226.tar.gz cuberite-50c6a660922410e9c010583f597ee3f011f43226.tar.bz2 cuberite-50c6a660922410e9c010583f597ee3f011f43226.tar.lz cuberite-50c6a660922410e9c010583f597ee3f011f43226.tar.xz cuberite-50c6a660922410e9c010583f597ee3f011f43226.tar.zst cuberite-50c6a660922410e9c010583f597ee3f011f43226.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Protocol132.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/Protocol132.cpp b/source/Protocol132.cpp index 207266d99..32fd4b63c 100644 --- a/source/Protocol132.cpp +++ b/source/Protocol132.cpp @@ -13,6 +13,7 @@ #include "ChunkDataSerializer.h"
#include "cPlayer.h"
#include "cMonster.h"
+#include "UI/cWindow.h"
@@ -360,6 +361,26 @@ void cProtocol132::SendUnloadChunk(int a_ChunkX, int a_ChunkZ) +void cProtocol132::SendWholeInventory(const cWindow & a_Window)
+{
+ // 1.3.2 requires player inventory slots to be sent as SetSlot packets,
+ // otherwise it sometimes fails to update the window
+ super::SendWholeInventory(a_Window);
+ const cItem * Slots = m_Client->GetPlayer()->GetInventory().GetSlots();
+ int BaseOffset = a_Window.GetNumSlots() - cInventory::c_NumSlots + cInventory::c_MainOffset; // the number of non-inventory slots the window has; inventory follows
+ char WindowID = a_Window.GetWindowID();
+ for (int i = 0; i < cInventory::c_NumSlots - cInventory::c_MainOffset; i++)
+ {
+ SendInventorySlot(WindowID, BaseOffset + i, Slots[i + cInventory::c_MainOffset]);
+ } // for i - Slots[]
+ // Send even the item being dragged:
+ SendInventorySlot(-1, -1, m_Client->GetPlayer()->GetDraggingItem());
+}
+
+
+
+
+
AString cProtocol132::GetAuthServerID(void)
{
// http://wiki.vg/wiki/index.php?title=Session&oldid=2615
|