From de75c0a271c06e5569ec280ea04daadb9d4fea0c Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Fri, 10 Aug 2007 17:42:13 +0000 Subject: Removed colon in NPC choice messages. --- src/scripting/lua.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/scripting/lua.cpp') diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index 3ed5ca9..fd3eb4f 100644 --- a/src/scripting/lua.cpp +++ b/src/scripting/lua.cpp @@ -118,16 +118,23 @@ static int LuaMsg_NpcChoice(lua_State *s) { NPC *p = getNPC(s, 1); Character *q = getCharacter(s, 2); - size_t l; - char const *m = lua_tolstring(s, 3, &l); - if (!p || !q || !m) + if (!p || !q) { LOG_WARN("LuaMsg_NpcChoice called with incorrect parameters."); return 0; } MessageOut msg(GPMSG_NPC_CHOICE); msg.writeShort(p->getPublicID()); - msg.writeString(std::string(m), l); + for (int i = 3, i_end = lua_gettop(s); i <= i_end; ++i) + { + char const *m = lua_tostring(s, i); + if (!m) + { + LOG_WARN("LuaMsg_NpcChoice called with incorrect parameters."); + return 0; + } + msg.writeString(m); + } gameHandler->sendTo(q, msg); return 0; } -- cgit