forked from nalc/homedecor_modpack
fix #20 (undeclared globals)
This commit is contained in:
parent
daef49a255
commit
6c07a31857
@ -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 },
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user