mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Implement vector and node conversion in Lua (#12609)
Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
parent
23e9f5db43
commit
b38ffdec27
29 changed files with 191 additions and 167 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue