summaryrefslogtreecommitdiff
path: root/src/scriptapi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/scriptapi.cpp')
-rw-r--r--src/scriptapi.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp
index 8d472e6b8..3b0c15f8a 100644
--- a/src/scriptapi.cpp
+++ b/src/scriptapi.cpp
@@ -754,15 +754,18 @@ static int l_chat_send_all(lua_State *L)
return 0;
}
-// chat_send_player(name, text)
+// chat_send_player(name, text, prepend)
static int l_chat_send_player(lua_State *L)
{
const char *name = luaL_checkstring(L, 1);
const char *text = luaL_checkstring(L, 2);
+ bool prepend = true;
+ if (lua_isboolean(L, 3))
+ prepend = lua_toboolean(L, 3);
// Get server from registry
Server *server = get_server(L);
// Send
- server->notifyPlayer(name, narrow_to_wide(text));
+ server->notifyPlayer(name, narrow_to_wide(text), prepend);
return 0;
}