mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-16 16:11:06 +01:00
Update mcl_util.get_double_container_neighbor_pos() to use vector.offset
This commit is contained in:
parent
7d4b342d4d
commit
cba4644fab
1 changed files with 8 additions and 8 deletions
|
@ -110,23 +110,23 @@ end
|
||||||
function mcl_util.get_double_container_neighbor_pos(pos, param2, side)
|
function mcl_util.get_double_container_neighbor_pos(pos, param2, side)
|
||||||
if side == "right" then
|
if side == "right" then
|
||||||
if param2 == 0 then
|
if param2 == 0 then
|
||||||
return {x = pos.x - 1, y = pos.y, z = pos.z}
|
return vector.offset(pos, -1, 0, 0)
|
||||||
elseif param2 == 1 then
|
elseif param2 == 1 then
|
||||||
return {x = pos.x, y = pos.y, z = pos.z + 1}
|
return vector.offset(pos, 0, 0, 1)
|
||||||
elseif param2 == 2 then
|
elseif param2 == 2 then
|
||||||
return {x = pos.x + 1, y = pos.y, z = pos.z}
|
return vector.offset(pos, 1, 0, 0)
|
||||||
elseif param2 == 3 then
|
elseif param2 == 3 then
|
||||||
return {x = pos.x, y = pos.y, z = pos.z - 1}
|
return vector.offset(pos, 0, 0, -1)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if param2 == 0 then
|
if param2 == 0 then
|
||||||
return {x = pos.x + 1, y = pos.y, z = pos.z}
|
return vector.offset(pos, 1, 0, 0)
|
||||||
elseif param2 == 1 then
|
elseif param2 == 1 then
|
||||||
return {x = pos.x, y = pos.y, z = pos.z - 1}
|
return vector.offset(pos, 0, 0, -1)
|
||||||
elseif param2 == 2 then
|
elseif param2 == 2 then
|
||||||
return {x = pos.x - 1, y = pos.y, z = pos.z}
|
return vector.offset(pos, -1, 0, 0)
|
||||||
elseif param2 == 3 then
|
elseif param2 == 3 then
|
||||||
return {x = pos.x, y = pos.y, z = pos.z + 1}
|
return vector.offset(pos, 0, 0, 1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue