Fix bug with unconfigured turncontroller

This commit is contained in:
Joachim Stolberg 2022-04-26 22:35:28 +02:00
parent 3309316b18
commit 47c391c679

View File

@ -83,20 +83,24 @@ minetest.register_node("techage:ta4_turncontroller", {
meta:set_string("formspec", formspec(nvm, meta))
elseif fields.left then
meta:set_string("status", "")
local new_posses = fly.rotate_nodes(pos, nvm.lpos, "l")
if new_posses then
nvm.lpos = new_posses
local name = player:get_player_name()
mark.stop(name)
if nvm.lpos then
local new_posses = fly.rotate_nodes(pos, nvm.lpos, "l")
if new_posses then
nvm.lpos = new_posses
local name = player:get_player_name()
mark.stop(name)
end
end
meta:set_string("formspec", formspec(nvm, meta))
elseif fields.right then
meta:set_string("status", "")
local new_posses = fly.rotate_nodes(pos, nvm.lpos, "r")
if new_posses then
nvm.lpos = new_posses
local name = player:get_player_name()
mark.stop(name)
if nvm.lpos then
local new_posses = fly.rotate_nodes(pos, nvm.lpos, "r")
if new_posses then
nvm.lpos = new_posses
local name = player:get_player_name()
mark.stop(name)
end
end
meta:set_string("formspec", formspec(nvm, meta))
end