Duplicate facedir due to weird bug

This commit is contained in:
Evert Prants 2018-04-09 12:23:30 +03:00
parent b478c8e298
commit ac0f076c37
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
2 changed files with 11 additions and 1 deletions

View File

@ -231,6 +231,11 @@ minetest.register_node("holostorage:external_storage_bus", {
meta:set_string("inv_name", "")
end,
after_dig_node = holostorage.network.clear_networks,
on_destruct = function (pos)
local node = minetest.get_node(pos)
local front = holostorage.front(pos, node.param2)
minetest.forceload_free_block(front)
end,
holostorage_run = function (pos, _, controller)
local node = minetest.get_node(pos)
local meta = minetest.get_meta(pos)
@ -242,6 +247,7 @@ minetest.register_node("holostorage:external_storage_bus", {
local front_inv = front_meta:get_inventory()
if front_inv:get_list("main") then
local pos_str = minetest.pos_to_string(front)
minetest.forceload_block(front)
meta:set_string("infotext", "Serving Inventory at "..pos_str)
meta:set_string("inv_pos", pos_str)
meta:set_string("inv_name", "main")

View File

@ -36,7 +36,11 @@ function holostorage.helpers.grid_refresh(pos, n, controller)
end
function holostorage.front(pos, fd)
local front = minetest.facedir_to_dir(fd)
local back = minetest.facedir_to_dir(fd)
local front = {}
for i, v in pairs(back) do
front[i] = v
end
front.x = front.x * -1 + pos.x
front.y = front.y * -1 + pos.y
front.z = front.z * -1 + pos.z