summaryrefslogtreecommitdiff
path: root/src/scripting
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-10 17:42:13 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-10 17:42:13 +0000
commitde75c0a271c06e5569ec280ea04daadb9d4fea0c (patch)
tree148453282ec5d4196757af0725ea4f7463bab97d /src/scripting
parentf562abbf2980c66e5c16f30ea667b758e796ae4e (diff)
downloadmanaserv-de75c0a271c06e5569ec280ea04daadb9d4fea0c.tar.gz
manaserv-de75c0a271c06e5569ec280ea04daadb9d4fea0c.tar.bz2
manaserv-de75c0a271c06e5569ec280ea04daadb9d4fea0c.tar.xz
manaserv-de75c0a271c06e5569ec280ea04daadb9d4fea0c.zip
Removed colon in NPC choice messages.
Diffstat (limited to 'src/scripting')
-rw-r--r--src/scripting/lua.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp
index 3ed5ca98..fd3eb4f4 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;
}