summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-03-21 03:57:03 +0300
committerAndrei Karas <akaras@inbox.ru>2017-03-21 18:15:26 +0300
commite2864bf7fadbfc7a6ce6bbd5ef7a3645e1904b11 (patch)
treeeb3d20b53400ac023438949fec8421fa5e3bd843
parenta8b6ff8bf24732107afed64f52b37a1b6bcb9f22 (diff)
downloadmv-e2864bf7fadbfc7a6ce6bbd5ef7a3645e1904b11.tar.gz
mv-e2864bf7fadbfc7a6ce6bbd5ef7a3645e1904b11.tar.bz2
mv-e2864bf7fadbfc7a6ce6bbd5ef7a3645e1904b11.tar.xz
mv-e2864bf7fadbfc7a6ce6bbd5ef7a3645e1904b11.zip
Fix packet CMSG_NPC_STR_RESPONSE for hercules packet version >= 20151029.
This packet version for now not supported by manaplus, and this is for future usage.
-rw-r--r--src/net/eathena/npchandler.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp
index f8041940c..6cb30bb81 100644
--- a/src/net/eathena/npchandler.cpp
+++ b/src/net/eathena/npchandler.cpp
@@ -44,6 +44,7 @@
#include "debug.h"
extern Net::NpcHandler *npcHandler;
+extern int packetVersion;
namespace EAthena
{
@@ -107,10 +108,19 @@ void NpcHandler::stringInput(const BeingId npcId,
const std::string &value) const
{
createOutPacket(CMSG_NPC_STR_RESPONSE);
- outMsg.writeInt16(CAST_S16(value.length() + 9), "len");
- outMsg.writeBeingId(npcId, "npc id");
- outMsg.writeString(value, CAST_S32(value.length()), "value");
- outMsg.writeInt8(0, "null byte");
+ if (packetVersion >= 20151029)
+ {
+ outMsg.writeInt16(CAST_S16(value.length() + 8), "len");
+ outMsg.writeBeingId(npcId, "npc id");
+ outMsg.writeString(value, CAST_S32(value.length()), "value");
+ }
+ else
+ {
+ outMsg.writeInt16(CAST_S16(value.length() + 9), "len");
+ outMsg.writeBeingId(npcId, "npc id");
+ outMsg.writeString(value, CAST_S32(value.length()), "value");
+ outMsg.writeInt8(0, "null byte");
+ }
}
void NpcHandler::buy(const Being *const being) const