From 5f4a9b697438f38629a9839105e7a284b39e0cde Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 1 Apr 2016 19:07:21 +0300 Subject: Sort more packets. Add version checks inside packets. --- src/net/eathena/cashshoprecv.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/net/eathena/cashshoprecv.cpp') diff --git a/src/net/eathena/cashshoprecv.cpp b/src/net/eathena/cashshoprecv.cpp index b427fd5df..0e868cda3 100644 --- a/src/net/eathena/cashshoprecv.cpp +++ b/src/net/eathena/cashshoprecv.cpp @@ -30,6 +30,8 @@ #include "debug.h" +extern int packetVersion; + namespace EAthena { @@ -40,13 +42,18 @@ namespace CashShopRecv void CashShopRecv::processCashShopOpen(Net::MessageIn &msg) { - const int count = (msg.readInt16("len") - 12) / 11; + int count; + if (packetVersion >= 20070711) + count = (msg.readInt16("len") - 12) / 11; + else + count = (msg.readInt16("len") - 8) / 11; CREATEWIDGETV(mBuyDialog, BuyDialog, fromInt(BuyDialog::Cash, BeingId)); mBuyDialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY)); msg.readInt32("cash points"); - msg.readInt32("kafra points"); + if (packetVersion >= 20070711) + msg.readInt32("kafra points"); for (int f = 0; f < count; f ++) { msg.readInt32("price"); -- cgit v1.2.3-70-g09d2