Fix crash when switching station is placed

This commit is contained in:
Louis 2020-04-07 16:22:39 +02:00
parent 026c1ae6fe
commit 946f54070b
7 changed files with 8 additions and 7 deletions

View File

@ -8,5 +8,5 @@ minetest.register_craft({
}
})
technic.register_cable(S("HV"), 3/16, "hv")
technic.register_cable(S("HV"), 3/16, "HV")

View File

@ -1,5 +1,5 @@
technic.register_tier("HV", "High Voltage")
technic.register_tier("HV")
local path = technic.modpath.."/machines/HV"

View File

@ -10,5 +10,5 @@ minetest.register_craft({
}
})
technic.register_cable(S("LV"), 2/16, "lv")
technic.register_cable(S("LV"), 2/16, "LV")

View File

@ -1,5 +1,5 @@
technic.register_tier("LV", "Low Voltage")
technic.register_tier("LV")
local path = technic.modpath.."/machines/LV"

View File

@ -10,5 +10,5 @@ minetest.register_craft({
}
})
technic.register_cable(S("MV"), 2.5/16, "mv")
technic.register_cable(S("MV"), 2.5/16, "MV")

View File

@ -1,5 +1,5 @@
technic.register_tier("MV", "Medium Voltage")
technic.register_tier("MV")
local path = technic.modpath.."/machines/MV"

View File

@ -11,12 +11,13 @@ technic.power_tools = {}
technic.networks = {}
function technic.register_tier(tier, description)
function technic.register_tier(tier)
technic.machines[tier] = {}
end
function technic.register_machine(tier, nodename, machine_type)
if not technic.machines[tier] then
print("Warning: trying to register a machine with an unregistered tier")
return
end
technic.machines[tier][nodename] = machine_type