forked from VoxeLibre/VoxeLibre
[mcl_comparators] fix warnings
This commit is contained in:
parent
3fbcacac3b
commit
52b1473657
|
@ -217,14 +217,14 @@ if minetest.get_modpath("screwdriver") then
|
|||
end
|
||||
|
||||
for _, mode in pairs{"comp", "sub"} do
|
||||
for _, state in pairs{mesecon.state.on, mesecon.state.off} do
|
||||
for _, state in pairs{mesecon.state.on, mesecon.state.off} do
|
||||
local state_str = state_strs[state]
|
||||
local nodename =
|
||||
"mcl_comparators:comparator_"..state_strs[state].."_"..mode
|
||||
"mcl_comparators:comparator_"..state_str.."_"..mode
|
||||
|
||||
-- Help
|
||||
local longdesc, usagehelp, use_help
|
||||
if state_strs[state] == "off" and mode == "comp" then
|
||||
if state_str == "off" and mode == "comp" then
|
||||
longdesc = S("Redstone comparators are multi-purpose redstone components.").."\n"..
|
||||
S("They can transmit a redstone signal, detect whether a block contains any items and compare multiple signals.")
|
||||
|
||||
|
@ -245,9 +245,9 @@ for _, state in pairs{mesecon.state.on, mesecon.state.off} do
|
|||
_doc_items_longdesc = longdesc,
|
||||
_doc_items_usagehelp = usagehelp,
|
||||
drawtype = "nodebox",
|
||||
tiles = get_tiles(state_strs[state], mode),
|
||||
tiles = get_tiles(state_str, mode),
|
||||
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
|
||||
wield_image = "mcl_comparators_off.png",
|
||||
--wield_image = "mcl_comparators_off.png",
|
||||
walkable = true,
|
||||
selection_box = collision_box,
|
||||
collision_box = collision_box,
|
||||
|
@ -263,7 +263,7 @@ for _, state in pairs{mesecon.state.on, mesecon.state.off} do
|
|||
drop = 'mcl_comparators:comparator_off_comp',
|
||||
on_construct = update_self,
|
||||
on_rightclick =
|
||||
make_rightclick_handler(state_strs[state], mode),
|
||||
make_rightclick_handler(state_str, mode),
|
||||
comparator_mode = mode,
|
||||
comparator_onstate = "mcl_comparators:comparator_on_"..mode,
|
||||
comparator_offstate = "mcl_comparators:comparator_off_"..mode,
|
||||
|
@ -287,7 +287,7 @@ for _, state in pairs{mesecon.state.on, mesecon.state.off} do
|
|||
else
|
||||
nodedef.groups = table.copy(nodedef.groups)
|
||||
nodedef.groups.not_in_creative_inventory = 1
|
||||
local extra_desc = {}
|
||||
--local extra_desc = {}
|
||||
if mode == "sub" or state == mesecon.state.on then
|
||||
nodedef.inventory_image = nil
|
||||
end
|
||||
|
@ -304,7 +304,7 @@ for _, state in pairs{mesecon.state.on, mesecon.state.off} do
|
|||
|
||||
minetest.register_node(nodename, nodedef)
|
||||
mcl_wip.register_wip_item(nodename)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Register recipies
|
||||
|
|
Loading…
Reference in New Issue