From 29d1c51ef1e6db79758cb56bc3fe85a07f09ff64 Mon Sep 17 00:00:00 2001 From: SX <50966843+S-S-X@users.noreply.github.com> Date: Mon, 16 Jun 2025 01:42:14 +0300 Subject: [PATCH 1/2] Fix switching station default infotext --- technic/machines/switching_station.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/technic/machines/switching_station.lua b/technic/machines/switching_station.lua index b230d85b..eeaf6f30 100644 --- a/technic/machines/switching_station.lua +++ b/technic/machines/switching_station.lua @@ -7,6 +7,7 @@ local S = technic.getter local mat = technic.materials local cable_entry = "^technic_cable_connection_overlay.png" +local no_network_infotext = S("@1 Has No Network", S("Switching Station")) minetest.register_craft({ output = "technic:switching_station", @@ -21,7 +22,7 @@ local function start_network(pos) local tier = technic.sw_pos2tier(pos) if not tier then local meta = minetest.get_meta(pos) - meta:set_string("infotext", S("@1 Has No Network", S("Switching Station"))) + meta:set_string("infotext", no_network_infotext) else local network_id = technic.sw_pos2network(pos) or technic.create_network(pos) local network = network_id and technic.networks[network_id] @@ -116,7 +117,7 @@ minetest.register_node("technic:switching_station",{ end end end - meta:set_string("infotext", infotext) + meta:set_string("infotext", infotext or no_network_infotext) else -- Network does not exist yet, attempt to create new network here start_network(pos) From 1e271bc316e9b8ee0b4e02aa9129edd503878082 Mon Sep 17 00:00:00 2001 From: SX <50966843+S-S-X@users.noreply.github.com> Date: Mon, 16 Jun 2025 01:55:34 +0300 Subject: [PATCH 2/2] Also return new infotext after setting it --- technic/machines/network.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/technic/machines/network.lua b/technic/machines/network.lua index d26212d6..f8cbf90f 100644 --- a/technic/machines/network.lua +++ b/technic/machines/network.lua @@ -151,9 +151,8 @@ function technic.network_infotext(network_id, text) local count = 0 for _ in pairs(network.all_nodes) do count = count + 1 end return S("Building Network: @1 Nodes", count) - else - return network.infotext end + return network.infotext end end