mirror of
https://github.com/joe7575/tubelib2.git
synced 2024-07-04 15:05:23 +02:00
Fix bug in get_node_lvm()
This commit is contained in:
parent
fce21d9cf8
commit
bd8bcce7b2
@ -84,12 +84,14 @@ function Tube:get_node_lvm(pos)
|
||||
local data = vm:get_data()
|
||||
local param2_data = vm:get_param2_data()
|
||||
local area = VoxelArea:new({MinEdge = MinEdge, MaxEdge = MaxEdge})
|
||||
local idx = area:index(pos.x, pos.y, pos.z)
|
||||
node = {
|
||||
name = minetest.get_name_from_content_id(data[idx]),
|
||||
param2 = param2_data[idx]
|
||||
}
|
||||
return node
|
||||
local idx = area:indexp(pos)
|
||||
if data[idx] and param2_data[idx] then
|
||||
return {
|
||||
name = minetest.get_name_from_content_id(data[idx]),
|
||||
param2 = param2_data[idx]
|
||||
}
|
||||
end
|
||||
return {name="ignore", param2=0}
|
||||
end
|
||||
|
||||
-- Read param2 from a primary node at the given position.
|
||||
|
12
tube_api.lua
12
tube_api.lua
@ -59,11 +59,13 @@ function tubelib2.get_node_lvm(pos)
|
||||
local param2_data = vm:get_param2_data()
|
||||
local area = VoxelArea:new({MinEdge = MinEdge, MaxEdge = MaxEdge})
|
||||
local idx = area:indexp(pos)
|
||||
node = {
|
||||
name = minetest.get_name_from_content_id(data[idx]),
|
||||
param2 = param2_data[idx]
|
||||
}
|
||||
return node
|
||||
if data[idx] and param2_data[idx] then
|
||||
return {
|
||||
name = minetest.get_name_from_content_id(data[idx]),
|
||||
param2 = param2_data[idx]
|
||||
}
|
||||
end
|
||||
return {name="ignore", param2=0}
|
||||
end
|
||||
|
||||
local function update1(self, pos, dir)
|
||||
|
Loading…
Reference in New Issue
Block a user