From 27f0c26e29d2e129d2220b9460ad462673b3db82 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sat, 3 Nov 2018 17:33:04 +1000 Subject: [PATCH] add location to lua_glue --- src/lua_glue.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lua_glue.c b/src/lua_glue.c index 7100451..dfab524 100644 --- a/src/lua_glue.c +++ b/src/lua_glue.c @@ -203,6 +203,12 @@ int l_getUserHandle(lua_State *L) { return 1; } +int l_getUserLocation(lua_State *L) { + lua_pushstring(L, gUser->location); + + return 1; +} + int l_messageFound(lua_State *L) { int conference = lua_tointeger(L, 1); int area = lua_tointeger(L, 2); @@ -644,6 +650,8 @@ void lua_push_cfunctions(lua_State *L) { lua_setglobal(L, "bbs_full_mail_scan"); lua_pushcfunction(L, l_getUserHandle); lua_setglobal(L, "bbs_get_userhandle"); + lua_pushcfunction(L, l_getUserLocation); + lua_setglobal(L, "bbs_get_userlocation"); lua_pushcfunction(L, l_messageFound); lua_setglobal(L, "bbs_message_found"); lua_pushcfunction(L, l_readMessageHdr);