From 97bb86afa0b876b418aa94795bf5c3b513a76f3c Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Tue, 21 May 2019 23:41:17 +0200 Subject: [PATCH] bug fixes --- power/electric_cable.lua | 5 ++++- power/power.lua | 2 +- power/powerswitch.lua | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/power/electric_cable.lua b/power/electric_cable.lua index ab8c77e..9b24ae8 100644 --- a/power/electric_cable.lua +++ b/power/electric_cable.lua @@ -29,7 +29,10 @@ local Cable = tubelib2.Tube:new({ primary_node_names = {"techage:electric_cableS", "techage:electric_cableA"}, secondary_node_names = {}, after_place_tube = function(pos, param2, tube_type, num_tubes) - minetest.swap_node(pos, {name = "techage:electric_cable"..tube_type, param2 = param2 % 32}) + -- Don't replace "hidden" cable + if M(pos):get_string("techage_hidden_nodename") == "" then + minetest.swap_node(pos, {name = "techage:electric_cable"..tube_type, param2 = param2 % 32}) + end M(pos):set_int("tl2_param2", param2) end, }) diff --git a/power/power.lua b/power/power.lua index 316d5ce..3717e76 100644 --- a/power/power.lua +++ b/power/power.lua @@ -161,7 +161,7 @@ function techage.power.power_cut(pos, dir, cable, cut) if param2 ~= 0 then meta:set_int("cable_cut", param2) meta:set_int("tl2_param2", 0) - cable:after_dig_node(npos) + cable:after_dig_tube(npos, {param2 = param2}) end else local param2 = meta:get_int("cable_cut") diff --git a/power/powerswitch.lua b/power/powerswitch.lua index 6007cfe..60f4ab1 100644 --- a/power/powerswitch.lua +++ b/power/powerswitch.lua @@ -120,7 +120,7 @@ minetest.register_node("techage:powerswitch_on", { }) minetest.register_craft({ - output = "techage:powerswitch_on 2", + output = "techage:powerswitch 2", recipe = { {"", "", ""}, {"dye:yellow", "dye:red", "dye:yellow"},