This commit is contained in:
Joachim Stolberg 2022-04-24 20:39:26 +02:00
parent 8b0d340344
commit 2df3d3a523
3 changed files with 16 additions and 11 deletions

View File

@ -57,16 +57,18 @@ local function get_remote_pos(pos, rmt_name)
end end
local function get_free_server_list(pos, owner) local function get_free_server_list(pos, owner)
local tbl = {M(pos):get_string("remote_name")} if Stations and Stations.get_node_table then
for key,item in pairs(Stations:get_node_table(pos)) do local tbl = {M(pos):get_string("remote_name")}
if item.single and item.owner == owner then for key,item in pairs(Stations:get_node_table(pos) or {}) do
if M(pos):get_string("node_type") == M(S2P(key)):get_string("node_type") then if item.single and item.owner == owner then
tbl[#tbl+1] = item.conn_name if M(pos):get_string("node_type") == M(S2P(key)):get_string("node_type") then
tbl[#tbl+1] = item.conn_name
end
end end
end end
tbl[#tbl+1] = ""
return tbl
end end
tbl[#tbl+1] = ""
return tbl
end end
local function on_lose_connection(pos, node_type) local function on_lose_connection(pos, node_type)
@ -78,8 +80,11 @@ local function on_lose_connection(pos, node_type)
end end
local function on_dropdown(pos) local function on_dropdown(pos)
local owner = M(pos):get_string("owner") if pos then
return table.concat(get_free_server_list(pos, owner), ",") local owner = M(pos):get_string("owner")
return table.concat(get_free_server_list(pos, owner), ",") or ""
end
return ""
end end
local function update_node_data(pos, state, conn_name, remote_name, rmt_pos) local function update_node_data(pos, state, conn_name, remote_name, rmt_pos)

View File

@ -572,6 +572,8 @@ function techage.add_expoint(player, number)
end end
end end
-- Delete number with: `//lua minetest.get_player_by_name("<name>"):get_meta():set_string("techage_collider_number", "")`
function techage.on_remove_collider(player) function techage.on_remove_collider(player)
if player and player.get_meta then if player and player.get_meta then
local meta = player:get_meta() local meta = player:get_meta()

View File

@ -511,8 +511,6 @@ techage.ConstructionPlans["ta5_teleport"] = {
{false, false, false, false, false, false, false, false, false, false, false}, {false, false, false, false, false, false, false, false, false, false, false},
{false, false, false, false, false, false, false, false, false, false, false}, {false, false, false, false, false, false, false, false, false, false, false},
{false, TANK4, PUMP4, TELEP, false, ARROW, false, TELEP, PIPEH, TANK4, false}, {false, TANK4, PUMP4, TELEP, false, ARROW, false, TELEP, PIPEH, TANK4, false},
{false, false, false, false, false, false, false, false, false, false, false},
{false, TANK4, PIPEH, TELEP, false, ARROW, false, TELEP, PUMP4, TANK4, false},
} }
-- --