summaryrefslogtreecommitdiff
path: root/src/net/eathena/vendingrecv.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-02 21:25:09 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-02 21:25:09 +0300
commit9ea600fb354e7de0b9a66dc065ca039e3f75d7f8 (patch)
treea94ca9bfd4ec2c0f671892bb5645abf8cb15e760 /src/net/eathena/vendingrecv.cpp
parent0ab403f92f7827afc45c4e07d3527a405e2e88e8 (diff)
downloadplus-9ea600fb354e7de0b9a66dc065ca039e3f75d7f8.tar.gz
plus-9ea600fb354e7de0b9a66dc065ca039e3f75d7f8.tar.bz2
plus-9ea600fb354e7de0b9a66dc065ca039e3f75d7f8.tar.xz
plus-9ea600fb354e7de0b9a66dc065ca039e3f75d7f8.zip
Sort more packets. Add version checks inside packets.
Diffstat (limited to 'src/net/eathena/vendingrecv.cpp')
-rw-r--r--src/net/eathena/vendingrecv.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/net/eathena/vendingrecv.cpp b/src/net/eathena/vendingrecv.cpp
index 3b3b000e5..4c609a766 100644
--- a/src/net/eathena/vendingrecv.cpp
+++ b/src/net/eathena/vendingrecv.cpp
@@ -143,7 +143,14 @@ void VendingRecv::processBuyAck(Net::MessageIn &msg)
void VendingRecv::processOpen(Net::MessageIn &msg)
{
- const int count = (msg.readInt16("len") - 8) / 22;
+ int packetLen = 22;
+ if ((serverVersion >= 8 || serverVersion == 0) &&
+ msg.getVersion() >= 20150226)
+ {
+ packetLen += 25;
+ }
+
+ const int count = (msg.readInt16("len") - 8) / packetLen;
msg.readInt32("id");
for (int f = 0; f < count; f ++)
{
@@ -159,7 +166,7 @@ void VendingRecv::processOpen(Net::MessageIn &msg)
msg.readInt16("card");
// ++ need change to msg.getVersion()
if ((serverVersion >= 8 || serverVersion == 0) &&
- packetVersion >= 20150226)
+ msg.getVersion() >= 20150226)
{
for (int d = 0; d < 5; d ++)
{