summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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