1
0
Fork 0
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:
Jude Melton-Houghton 2022-10-18 18:01:44 -04:00 committed by GitHub
parent 23e9f5db43
commit b38ffdec27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 191 additions and 167 deletions

View file

@ -139,12 +139,10 @@ int LuaVoxelManip::l_get_node_at(lua_State *L)
{
NO_MAP_LOCK_REQUIRED;
const NodeDefManager *ndef = getServer(L)->getNodeDefManager();
LuaVoxelManip *o = checkObject<LuaVoxelManip>(L, 1);
v3s16 pos = check_v3s16(L, 2);
pushnode(L, o->vm->getNodeNoExNoEmerge(pos), ndef);
pushnode(L, o->vm->getNodeNoExNoEmerge(pos));
return 1;
}
@ -152,11 +150,9 @@ int LuaVoxelManip::l_set_node_at(lua_State *L)
{
NO_MAP_LOCK_REQUIRED;
const NodeDefManager *ndef = getServer(L)->getNodeDefManager();
LuaVoxelManip *o = checkObject<LuaVoxelManip>(L, 1);
v3s16 pos = check_v3s16(L, 2);
MapNode n = readnode(L, 3, ndef);
MapNode n = readnode(L, 3);
o->vm->setNodeNoEmerge(pos, n);