This commit is contained in:
Joachim Stolberg 2022-04-25 18:00:26 +02:00
parent 2df3d3a523
commit 094d448386

View File

@ -388,13 +388,14 @@ end
-- Handover the entity to the next movecontroller -- Handover the entity to the next movecontroller
local function handover_to(obj, self, pos1) local function handover_to(obj, self, pos1)
if self.handover then
local info = techage.get_node_info(self.handover) local info = techage.get_node_info(self.handover)
if info and info.name == "techage:ta4_movecontroller" then if info and info.name == "techage:ta4_movecontroller" then
local meta = M(info.pos) local meta = M(info.pos)
if self.move2to1 then if self.move2to1 then
self.handover = meta:contains("handoverA") and meta:get_string("handoverA") self.handover = meta:contains("handoverA") and meta:get_string("handoverA") or nil
else else
self.handover = meta:contains("handoverB") and meta:get_string("handoverB") self.handover = meta:contains("handoverB") and meta:get_string("handoverB") or nil
end end
self.lpath = flylib.to_path(meta:get_string("path")) self.lpath = flylib.to_path(meta:get_string("path"))
@ -420,6 +421,7 @@ local function handover_to(obj, self, pos1)
return true return true
end end
end end
end
end end
minetest.register_entity("techage:move_item", { minetest.register_entity("techage:move_item", {
@ -671,9 +673,9 @@ function flylib.move_to_other_pos(pos, move2to1)
nvm.lpos2 = lvect_add_vec(nvm.lpos1, offs) nvm.lpos2 = lvect_add_vec(nvm.lpos1, offs)
if move2to1 then if move2to1 then
handover = meta:contains("handoverA") and meta:get_string("handoverA") handover = meta:contains("handoverA") and meta:get_string("handoverA") or nil
else else
handover = meta:contains("handoverB") and meta:get_string("handoverB") handover = meta:contains("handoverB") and meta:get_string("handoverB") or nil
end end
return move_nodes(pos, meta, nvm, lpath, max_speed, height, move2to1, handover) return move_nodes(pos, meta, nvm, lpath, max_speed, height, move2to1, handover)
end end