Console overhaul, part 2. New console is mostly working.

This commit is contained in:
2025-12-09 15:51:35 -05:00
parent 2d1def8dc6
commit a0703effc3
10 changed files with 51 additions and 21 deletions

View File

@@ -874,9 +874,8 @@ void World::invoke_lua_expr(int64_t actor_id, int64_t place_id, std::string_view
LuaExtStack LS(L, func);
// create the compiled closure.
int status = luaL_loadbuffer(L, datapack.data(), datapack.size(), "=invoke");
lua_replace(L, func.index());
if (status != LUA_OK) {
eng::string error = LS.load(func, datapack, "=invoke");
if (!error.empty()) {
// The closure is actually an error message. Do nothing.
// This should normally not happen: LuaConsole should filter
// out syntax errors.