diff options
Diffstat (limited to 'src/script/cpp_api/s_base.cpp')
-rw-r--r-- | src/script/cpp_api/s_base.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/script/cpp_api/s_base.cpp b/src/script/cpp_api/s_base.cpp index 54ff8c495..293c774b0 100644 --- a/src/script/cpp_api/s_base.cpp +++ b/src/script/cpp_api/s_base.cpp @@ -133,7 +133,7 @@ int ScriptApiBase::luaPanic(lua_State *L) { std::ostringstream oss; oss << "LUA PANIC: unprotected error in call to Lua API (" - << lua_tostring(L, -1) << ")"; + << readParam<std::string>(L, -1) << ")"; FATAL_ERROR(oss.str().c_str()); // NOTREACHED return 0; @@ -184,7 +184,7 @@ void ScriptApiBase::loadScript(const std::string &script_path) } ok = ok && !lua_pcall(L, 0, 0, error_handler); if (!ok) { - std::string error_msg = lua_tostring(L, -1); + std::string error_msg = readParam<std::string>(L, -1); lua_pop(L, 2); // Pop error message and error handler throw ModError("Failed to load and run script from " + script_path + ":\n" + error_msg); @@ -286,10 +286,10 @@ void ScriptApiBase::stackDump(std::ostream &o) int t = lua_type(m_luastack, i); switch (t) { case LUA_TSTRING: /* strings */ - o << "\"" << lua_tostring(m_luastack, i) << "\""; + o << "\"" << readParam<std::string>(m_luastack, i) << "\""; break; case LUA_TBOOLEAN: /* booleans */ - o << (lua_toboolean(m_luastack, i) ? "true" : "false"); + o << (readParam<bool>(m_luastack, i) ? "true" : "false"); break; case LUA_TNUMBER: /* numbers */ { char buf[10]; |