Skip to content

Commit bfb7084

Browse files
authored
Fix switching station default infotext (#410)
1 parent d469c2a commit bfb7084

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

technic/machines/network.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,8 @@ function technic.network_infotext(network_id, text)
151151
local count = 0
152152
for _ in pairs(network.all_nodes) do count = count + 1 end
153153
return S("Building Network: @1 Nodes", count)
154-
else
155-
return network.infotext
156154
end
155+
return network.infotext
157156
end
158157
end
159158

technic/machines/switching_station.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ local S = technic.getter
77
local mat = technic.materials
88

99
local cable_entry = "^technic_cable_connection_overlay.png"
10+
local no_network_infotext = S("@1 Has No Network", S("Switching Station"))
1011

1112
minetest.register_craft({
1213
output = "technic:switching_station",
@@ -21,7 +22,7 @@ local function start_network(pos)
2122
local tier = technic.sw_pos2tier(pos)
2223
if not tier then
2324
local meta = minetest.get_meta(pos)
24-
meta:set_string("infotext", S("@1 Has No Network", S("Switching Station")))
25+
meta:set_string("infotext", no_network_infotext)
2526
else
2627
local network_id = technic.sw_pos2network(pos) or technic.create_network(pos)
2728
local network = network_id and technic.networks[network_id]
@@ -116,7 +117,7 @@ minetest.register_node("technic:switching_station",{
116117
end
117118
end
118119
end
119-
meta:set_string("infotext", infotext)
120+
meta:set_string("infotext", infotext or no_network_infotext)
120121
else
121122
-- Network does not exist yet, attempt to create new network here
122123
start_network(pos)

0 commit comments

Comments
 (0)