Fix fly controller 'move' bug
This commit is contained in:
parent
aedf234ae5
commit
0f14d504d5
@ -133,7 +133,7 @@ minetest.register_node("techage:ta5_flycontroller", {
|
|||||||
local path, err = fly.to_path(fields.path, MAX_DIST)
|
local path, err = fly.to_path(fields.path, MAX_DIST)
|
||||||
if err then
|
if err then
|
||||||
meta:set_string("status", err)
|
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])
|
local pos = table.copy(nvm.lpos1[1])
|
||||||
if pos then
|
if pos then
|
||||||
for _, offs in ipairs(path) do
|
for _, offs in ipairs(path) do
|
||||||
@ -179,8 +179,7 @@ minetest.register_node("techage:ta5_flycontroller", {
|
|||||||
meta:set_string("formspec", formspec(nvm, meta))
|
meta:set_string("formspec", formspec(nvm, meta))
|
||||||
elseif fields.move then
|
elseif fields.move then
|
||||||
meta:set_string("status", "")
|
meta:set_string("status", "")
|
||||||
nvm.moveBA = nvm.moveBA == false
|
if fly.move_to_other_pos(pos, nvm.moveBA) then
|
||||||
if fly.move_to_other_pos(pos, nvm.moveBA == false) then
|
|
||||||
nvm.moveBA = nvm.moveBA == false
|
nvm.moveBA = nvm.moveBA == false
|
||||||
nvm.running = true
|
nvm.running = true
|
||||||
meta:set_string("formspec", formspec(nvm, meta))
|
meta:set_string("formspec", formspec(nvm, meta))
|
||||||
|
Loading…
Reference in New Issue
Block a user