Skip to content
Snippets Groups Projects
Commit d6edbc02 authored by Peter Nerlich's avatar Peter Nerlich
Browse files

fix typo, fix feedback on delete, show "no neighbors found"

parent cf568a5f
No related branches found
No related tags found
No related merge requests found
...@@ -31,7 +31,8 @@ local update_formspec = function(meta) ...@@ -31,7 +31,8 @@ local update_formspec = function(meta)
meta:set_string("infotext", "Train: Line=" .. line .. ", Station=" .. station .. meta:set_string("infotext", "Train: Line=" .. line .. ", Station=" .. station ..
(prv ~= "" and (", prv="..prv) or "") .. (prv ~= "" and (", prv="..prv) or "") ..
(path ~= "" and " (found line)" or "") .. (path ~= "" and " (found line)" or "") ..
(nxt ~= "" and (", nxt="..nxt) or "")) (nxt ~= "" and (", nxt="..nxt) or "") ..
(line ~= "" and prv == "" and nxt == "" and (", no neighbors found") or ""))
meta:set_string("formspec", "size[8,4;]" .. meta:set_string("formspec", "size[8,4;]" ..
-- col 1 -- col 1
...@@ -100,7 +101,7 @@ minetest.register_node("mapserver:train", { ...@@ -100,7 +101,7 @@ minetest.register_node("mapserver:train", {
-- TODO: why doesn't this work properly? -- TODO: why doesn't this work properly?
update_neighbors(pos, fake_meta, player) update_neighbors(pos, fake_meta, player:get_player_name())
end, end,
on_receive_fields = function(pos, formname, fields, sender) on_receive_fields = function(pos, formname, fields, sender)
...@@ -172,7 +173,7 @@ minetest.register_on_punchnode(function(pos, node, sender, pointed_thing) ...@@ -172,7 +173,7 @@ minetest.register_on_punchnode(function(pos, node, sender, pointed_thing)
meta:set_string("rail_pos", minetest.pos_to_string(pos)) meta:set_string("rail_pos", minetest.pos_to_string(pos))
update_neighbors(blockpos, meta, name) update_neighbors(blockpos, meta, name)
else else
minetest.chat_send_player(name, "This is not rail! Aborted.") minetest.chat_send_player(name, "This is not a rail! Aborted.")
end end
else else
minetest.chat_send_player(name, "Node is too far away. Aborted.") minetest.chat_send_player(name, "Node is too far away. Aborted.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment