Implemented World::probe_lua_call and tested

This commit is contained in:
2024-09-01 19:43:00 -04:00
parent d4f46eef45
commit 47a570064c
9 changed files with 196 additions and 47 deletions

View File

@@ -171,7 +171,7 @@ std::optional<util::DXYZ> LuaCoreStack::tryxyz(LuaSlot s) const {
lua_rawgeti(L_, s, 3);
lua_rawgeti(L_, s, 2);
lua_rawgeti(L_, s, 1);
if (lua_isnumber(L_, -1) && lua_isnumber(L_, -2) && lua_isnumber(L_, -3)) {
if ((lua_type(L_, -1)==LUA_TNUMBER) && (lua_type(L_, -2)==LUA_TNUMBER) && (lua_type(L_, -3)==LUA_TNUMBER)) {
util::DXYZ result;
result.x = lua_tonumber(L_, -1);
result.y = lua_tonumber(L_, -2);