MCPcopy Create free account
hub / github.com/The-Powder-Toy/The-Powder-Toy / LuaToLoggableString

Function LuaToLoggableString

src/lua/LuaScriptInterface.cpp:94–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94int LuaToLoggableString(lua_State *L, int n)
95{
96 luaL_checkany(L, n);
97 switch (lua_type(L, n))
98 {
99 case LUA_TNUMBER:
100 lua_tostring(L, n);
101 lua_pushvalue(L, n);
102 break;
103 case LUA_TSTRING:
104 lua_pushvalue(L, n);
105 break;
106 case LUA_TBOOLEAN:
107 lua_pushstring(L, (lua_toboolean(L, n) ? "true" : "false"));
108 break;
109 case LUA_TNIL:
110 lua_pushliteral(L, "nil");
111 break;
112 default:
113 lua_pushfstring(L, "%s: %p", luaL_typename(L, n), lua_topointer(L, n));
114 break;
115 }
116 return 1;
117}
118
119String LuaGetError()
120{

Callers 3

LuaGetErrorFunction · 0.85
CommandMethod · 0.85
flogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected