From e847e4167f610ea40b36f0906ac643dc19ceaa31 Mon Sep 17 00:00:00 2001 From: Grossam Date: Tue, 13 Aug 2019 06:25:38 +0200 Subject: [PATCH] Doors righclick bug fixed --- README.md | 3 +++ doors.lua | 10 ++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c86e35a..d2036e2 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ Minetest mod that adds scifi themed blocks, doors, materials, plants and other a # Changes log +* 13/08/2019 : + * doors_open_with_mesecon_only is now a mod option (default is false) + * corrected a typo wich prevented the option to work properly * 05/09/2019 : door opening on rightclick is disabled (maybe reactivated via a mod option) * 05/08/2019 : * digicodes now work diff --git a/doors.lua b/doors.lua index c0eed8f..cffc92d 100644 --- a/doors.lua +++ b/doors.lua @@ -16,8 +16,7 @@ -- Retrieving mod settings local scifi_nodes = {} -scifi_nodes.doors_open_with_mesecon_only = minetest.settings:get_bool("scifi_nodes.doors_open_with_mesecon_only", true) -print("Ici !"..dump(scifi_nodes)) +scifi_nodes.doors_open_with_mesecon_only = minetest.settings:get_bool("scifi_nodes.doors_open_with_mesecon_only", false) -- Some aliases to deal with old namming policy -- minetest.register_alias("scifi_nodes:doors_1a","scifi_nodes:Doom_door_closed") @@ -267,9 +266,8 @@ for _, current_door in ipairs(doors) do rules = mesecons_doors_rules }, } - local doors_rightclick - if scifi_nodes.doors_open_with_mesecon_only then doors_rightclick = {} - else doors_rightclick = open_door end + local doors_rightclick = nil -- Crashes serv if empty table ! + if not scifi_nodes.doors_open_with_mesecon_only then doors_rightclick = open_doors end minetest.register_node(closed, { description = current_door.base_name.." sliding door", @@ -302,7 +300,7 @@ for _, current_door in ipairs(doors) do mesecons = mesecons_doors_def, on_place = onplace, after_destruct = afterdestruct, - on_rightclick = rightclick, + on_rightclick = doors_rightclick, }) minetest.register_node(closed_top, {