1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-12-22 16:10:18 +01:00

fix #20 (undeclared globals)

This commit is contained in:
Vanessa Dannenberg 2019-08-21 17:44:58 -04:00
parent daef49a255
commit 6c07a31857
2 changed files with 11 additions and 9 deletions

View File

@ -16,8 +16,6 @@ function homedecor.toggle_switch(pos, node, clicker, itemstack, pointed_thing)
end
local on_rc
local switch_receptor
if minetest.get_modpath("mesecons") then
on_rc = function(pos, node, clicker, itemstack, pointed_thing)
local t = homedecor.toggle_switch(pos, node, clicker, itemstack, pointed_thing)
@ -28,12 +26,6 @@ if minetest.get_modpath("mesecons") then
mesecon.receptor_on(pos, mesecon.rules.buttonlike_get(node))
end
end
switch_receptor = {
receptor = {
state = mesecon.state[onoff],
rules = mesecon.rules.buttonlike_get
}
}
end
homedecor.register("power_outlet", {
@ -65,6 +57,16 @@ homedecor.register("power_outlet", {
for _, onoff in ipairs ({"on", "off"}) do
local switch_receptor
if minetest.get_modpath("mesecons") then
switch_receptor = {
receptor = {
state = mesecon.state[onoff],
rules = mesecon.rules.buttonlike_get
}
}
end
local model = {
{ -0.125, -0.1875, 0.4375, 0.125, 0.125, 0.5 },
{ -0.03125, 0, 0.40625, 0.03125, 0.0625, 0.5 },

View File

@ -52,7 +52,7 @@ homedecor.register("armchair", {
palette = "unifieddyes_palette_colorwallmounted.png",
groups = {snappy=3, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
node_box = ac_cbox,
node_box = armchair_cbox,
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
end,