diff --git a/basic_machines/pusher.lua b/basic_machines/pusher.lua index 4365cf2..dd54148 100644 --- a/basic_machines/pusher.lua +++ b/basic_machines/pusher.lua @@ -128,7 +128,17 @@ local function pushing(pos, crd, meta, nvm) local num = nvm.item_count or nvm.num_items or crd.num_items num = push(pos, crd, meta, nvm, pull_dir, push_dir, num) if num > 0 then - crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) + if nvm.item_count then + nvm.item_count = nvm.item_count - num + if nvm.item_count <= 0 then + crd.State:stop(pos, nvm) + nvm.item_count = nil + else + crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) + end + end + else + crd.State:stop(pos, nvm) end elseif nvm.num_items < nvm.limit then local num = math.min(crd.num_items, nvm.limit - nvm.num_items) diff --git a/basis/fly_lib.lua b/basis/fly_lib.lua index 0c0e6fa..00ec087 100644 --- a/basis/fly_lib.lua +++ b/basis/fly_lib.lua @@ -102,7 +102,7 @@ function flylib.to_path(s, max_dist) tPath = tPath or {} tPath[#tPath + 1] = v else - return tPath, S("Error: Max. length of the flight route exceeded !!") + return tPath, S("Error: Max. length of the flight route exceeded by @1 blocks !!", dist - max_dist) end else return tPath, S("Error: Invalid path !!") diff --git a/locale/techage.de.tr b/locale/techage.de.tr index a6de983..9f7fa0b 100644 --- a/locale/techage.de.tr +++ b/locale/techage.de.tr @@ -446,7 +446,7 @@ Firebox=Feuerkasten ### fly_lib.lua ### Destination position is protected=Zielposition ist geschützt -Error: Max. length of the flight route exceeded !!=Fehler: Max. Flugstreckenlänge überschritten !! +Error: Max. length of the flight route exceeded by @1 blocks !!=Fehler: max. Länge der Flugstrecke um @1 Blöcke überschritten !! No valid destination position=Keine gültige Zielposition No valid node at the start position=Kein gültiger Block an der Startposition Start position is protected=Startposition ist geschützt @@ -1484,3 +1484,8 @@ Remove detector=Entferne Detektor TA4 Collider Detector Worker=TA4 Collider Detektor Worker [TA4] Detector is being built!=[TA4] Detektor wird gebaut! [TA4] Detector is being removed!=[TA4] Detektor wird entfernt! + + +##### not used anymore ##### + +Error: Max. length of the flight route exceeded !!=Fehler: Max. Flugstreckenlänge überschritten !! diff --git a/locale/template.txt b/locale/template.txt index 8c26558..aadfb66 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -446,7 +446,7 @@ Firebox= ### fly_lib.lua ### Destination position is protected= -Error: Max. length of the flight route exceeded !!= +Error: Max. length of the flight route exceeded by @1 blocks !!= No valid destination position= No valid node at the start position= Start position is protected= diff --git a/move_controller/flycontroller.lua b/move_controller/flycontroller.lua index 4f1c7ed..f5d33d7 100644 --- a/move_controller/flycontroller.lua +++ b/move_controller/flycontroller.lua @@ -46,7 +46,8 @@ local WRENCH_MENU = { local function formspec(nvm, meta) local status = meta:get_string("status") - local path = meta:contains("path") and meta:get_string("path") or "0,3,0" + local path = meta:contains("fs_path") and meta:get_string("fs_path") or + meta:contains("path") and meta:get_string("path") or "0,3,0" return "size[8,6.7]" .. "style_type[textarea;font=mono;textcolor=#FFFFFF;border=true]" .. "box[0,-0.1;7.2,0.5;#c6e8ff]" .. @@ -107,6 +108,7 @@ minetest.register_node("techage:ta5_flycontroller", { local pos_list = mark.get_poslist(name) local _, err = fly.to_path(fields.path, MAX_DIST) if not err then + meta:set_string("fs_path", fields.path) meta:set_string("path", fields.path) end nvm.running = nil @@ -120,8 +122,11 @@ minetest.register_node("techage:ta5_flycontroller", { local _, err = fly.to_path(fields.path, MAX_DIST) if not err then meta:set_string("path", fields.path) + meta:set_string("fs_path", fields.path) meta:set_string("status", S("Stored")) else + meta:set_string("path", "0,0,0") + meta:set_string("fs_path", fields.path) meta:set_string("status", err) end meta:set_string("formspec", formspec(nvm, meta))