summaryrefslogtreecommitdiff
path: root/src/scripting
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-05-06 16:34:55 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-05-06 16:42:01 +0200
commit1779934a18b8942005ee98ca6f4ca22607d21bc3 (patch)
tree0a49ebc9276e065a8284d004f1c7d13fe1cc166f /src/scripting
parentad9f6744cb61550d3dbda15a17cb3ca66cb4724b (diff)
downloadmanaserv-1779934a18b8942005ee98ca6f4ca22607d21bc3.tar.gz
manaserv-1779934a18b8942005ee98ca6f4ca22607d21bc3.tar.bz2
manaserv-1779934a18b8942005ee98ca6f4ca22607d21bc3.tar.xz
manaserv-1779934a18b8942005ee98ca6f4ca22607d21bc3.zip
Don't send NPC text as fixed-length string
This is intended to be used only when the string length is known. The client was deriving the length from the remaining amount of data in the message, but that doesn't work in the new 'debug mode' of the protocol. Reviewed-by: Ben Longbons
Diffstat (limited to 'src/scripting')
-rw-r--r--src/scripting/lua.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp
index ca4a3272..be722569 100644
--- a/src/scripting/lua.cpp
+++ b/src/scripting/lua.cpp
@@ -202,14 +202,13 @@ static int npc_message(lua_State *s)
{
NPC *p = checkNPC(s, 1);
Character *q = checkCharacter(s, 2);
- size_t l;
- const char *m = luaL_checklstring(s, 3, &l);
+ const char *m = luaL_checkstring(s, 3);
Script::Thread *thread = checkCurrentThread(s);
MessageOut msg(GPMSG_NPC_MESSAGE);
msg.writeInt16(p->getPublicID());
- msg.writeString(m, l);
+ msg.writeString(m);
gameHandler->sendTo(q, msg);
thread->mState = Script::ThreadPaused;