Add VALIDATE_LUA as a function in lpxserver and lpxclient
This commit is contained in:
@@ -377,14 +377,10 @@ eng::string World::probe_lua_expr(int64_t actor_id, std::string_view lua) {
|
||||
|
||||
LuaVar closure;
|
||||
LuaExtStack LS(L, closure);
|
||||
|
||||
// create the compiled closure.
|
||||
int status = luaL_loadbuffer(L, lua.data(), lua.size(), "=probe");
|
||||
lua_replace(L, closure.index());
|
||||
if (status != LUA_OK) {
|
||||
// The closure is actually an error message. Do nothing.
|
||||
// This should normally not happen: LuaConsole should filter
|
||||
// out syntax errors.
|
||||
eng::string errmsg = LS.load(closure, lua, "probe");
|
||||
if (!errmsg.empty()) {
|
||||
// This should normally not happen: the front end should
|
||||
// filter expressions for syntactic lua validity.
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user