diff options
Diffstat (limited to 'plugins/MirLua/src/mlua_utils.cpp')
-rw-r--r-- | plugins/MirLua/src/mlua_utils.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/plugins/MirLua/src/mlua_utils.cpp b/plugins/MirLua/src/mlua_utils.cpp index 3a58867171..7fa59212c5 100644 --- a/plugins/MirLua/src/mlua_utils.cpp +++ b/plugins/MirLua/src/mlua_utils.cpp @@ -5,7 +5,25 @@ int luaM_print(lua_State *L) CMStringA data;
int nargs = lua_gettop(L);
for (int i = 1; i <= nargs; ++i)
- data.AppendFormat("%s ", lua_tostring(L, i));
+ {
+ switch (lua_type(L, i))
+ {
+ case LUA_TNIL:
+ data.AppendFormat("%s ", "nil");
+ break;
+ case LUA_TBOOLEAN:
+ case LUA_TNUMBER:
+ case LUA_TSTRING:
+ data.AppendFormat("%s ", lua_tostring(L, i));
+ break;
+ case LUA_TTABLE:
+ data.AppendFormat("%s ", "table");
+ break;
+ default:
+ data.AppendFormat("0x%p ", lua_topointer(L, i));
+ break;
+ }
+ }
data.Delete(data.GetLength() - 3, 3);
CallService(MS_NETLIB_LOG, (WPARAM)hNetlib, (LPARAM)data.GetBuffer());
|