Implement vector and node conversion in Lua (#12609)

Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
Jude Melton-Houghton
2022-10-18 18:01:44 -04:00
committed by GitHub
parent 23e9f5db43
commit b38ffdec27
29 changed files with 191 additions and 167 deletions

View File

@@ -274,7 +274,6 @@ void ScriptApiEnv::on_liquid_transformed(
// Convert the list to a pos array and a node array for lua
int index = 1;
const NodeDefManager *ndef = getEnv()->getGameDef()->ndef();
lua_createtable(L, list.size(), 0);
lua_createtable(L, list.size(), 0);
for(std::pair<v3s16, MapNode> p : list) {
@@ -282,7 +281,7 @@ void ScriptApiEnv::on_liquid_transformed(
push_v3s16(L, p.first);
lua_rawset(L, -4);
lua_pushnumber(L, index++);
pushnode(L, p.second, ndef);
pushnode(L, p.second);
lua_rawset(L, -3);
}