summaryrefslogtreecommitdiffstats
path: root/source/Protocol/Protocol17x.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-11-08 21:32:14 +0100
committermadmaxoft <github@xoft.cz>2013-11-08 21:32:14 +0100
commit07fa8313b184e2a9d7666cf6f7b10d5def8dc928 (patch)
tree386d2e6ef3a5251e4ab2972b6620e5092a0ae546 /source/Protocol/Protocol17x.cpp
parentFixed code style. (diff)
downloadcuberite-07fa8313b184e2a9d7666cf6f7b10d5def8dc928.tar
cuberite-07fa8313b184e2a9d7666cf6f7b10d5def8dc928.tar.gz
cuberite-07fa8313b184e2a9d7666cf6f7b10d5def8dc928.tar.bz2
cuberite-07fa8313b184e2a9d7666cf6f7b10d5def8dc928.tar.lz
cuberite-07fa8313b184e2a9d7666cf6f7b10d5def8dc928.tar.xz
cuberite-07fa8313b184e2a9d7666cf6f7b10d5def8dc928.tar.zst
cuberite-07fa8313b184e2a9d7666cf6f7b10d5def8dc928.zip
Diffstat (limited to 'source/Protocol/Protocol17x.cpp')
-rw-r--r--source/Protocol/Protocol17x.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/source/Protocol/Protocol17x.cpp b/source/Protocol/Protocol17x.cpp
index a2b3a7a56..eee4f7d0e 100644
--- a/source/Protocol/Protocol17x.cpp
+++ b/source/Protocol/Protocol17x.cpp
@@ -841,21 +841,24 @@ void cProtocol172::SendWindowClose(const cWindow & a_Window)
-void cProtocol172::SendWindowOpen(char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots)
+void cProtocol172::SendWindowOpen(const cWindow & a_Window)
{
+ if (a_Window.GetWindowType() < 0)
+ {
+ // Do not send this packet for player inventory windows
+ return;
+ }
+
cPacketizer Pkt(*this, 0x2d);
- Pkt.WriteChar(a_WindowID);
- Pkt.WriteChar(a_WindowType);
- Pkt.WriteString(a_WindowTitle);
- Pkt.WriteChar(a_NumSlots);
+ Pkt.WriteChar(a_Window.GetWindowID());
+ Pkt.WriteChar(a_Window.GetWindowType());
+ Pkt.WriteString(a_Window.GetWindowTitle());
+ Pkt.WriteChar(a_Window.GetNumNonInventorySlots());
Pkt.WriteBool(true);
- /*
- // TODO:
- if (a_WindowType == cWindow::wtHorse)
+ if (a_Window.GetWindowType() == cWindow::wtAnimalChest)
{
- Pkt.WriteInt(HorseID);
+ Pkt.WriteInt(0); // TODO: The animal's EntityID
}
- */
}