diff --git a/move_controller/flycontroller.lua b/move_controller/flycontroller.lua index ca12aa1..b7790aa 100644 --- a/move_controller/flycontroller.lua +++ b/move_controller/flycontroller.lua @@ -133,7 +133,7 @@ minetest.register_node("techage:ta5_flycontroller", { local path, err = fly.to_path(fields.path, MAX_DIST) if err then meta:set_string("status", err) - elseif path and nvm.lpos1 then + elseif path and nvm.lpos1 and nvm.lpos1[1] then local pos = table.copy(nvm.lpos1[1]) if pos then for _, offs in ipairs(path) do @@ -179,8 +179,7 @@ minetest.register_node("techage:ta5_flycontroller", { meta:set_string("formspec", formspec(nvm, meta)) elseif fields.move then meta:set_string("status", "") - nvm.moveBA = nvm.moveBA == false - if fly.move_to_other_pos(pos, nvm.moveBA == false) then + if fly.move_to_other_pos(pos, nvm.moveBA) then nvm.moveBA = nvm.moveBA == false nvm.running = true meta:set_string("formspec", formspec(nvm, meta))