Fix warnings issued by `luacheck`.

This commit is contained in:
Diego Martínez 2017-02-15 23:53:52 -03:00
parent c8fa17801b
commit 2df6dbcad9
16 changed files with 17 additions and 70 deletions

View File

@ -15,6 +15,7 @@ read_globals = {
"beds",
"technic",
"mesecon",
"unifieddyes",
}
globals = {

View File

@ -142,8 +142,8 @@ minetest.register_lbm({
action = function(pos, node)
local name = node.name
local newname = "homedecor:bathroom_tiles_light"
local a,b = string.find(node.name, "_")
local color = string.sub(node.name, a + 1)
local a = string.find(name, "_")
local color = string.sub(name, a + 1)
if color == "tan" then
color = "yellow_s50"

View File

@ -233,7 +233,9 @@ minetest.register_lbm({
action = function(pos, node)
local name = node.name
local color = string.sub(name, string.find(name, "_") + 1)
local color = string.sub(color, 1, string.find(color, "_", -10) - 1) -- -10 puts us near the end of the color field
-- -10 puts us near the end of the color field
color = string.sub(color, 1, string.find(color, "_", -10) - 1)
if color == "darkgrey" then
color = "dark_grey"

View File

@ -1,8 +1,6 @@
local S = homedecor_i18n.gettext
local function N_(x) return x end
local BOOK_FORMNAME = "homedecor:book_form"
local player_current_book = { }

View File

@ -2476,18 +2476,6 @@ minetest.register_craft( {
},
})
local bedcolors = {
{ "red", "red"},
{ "orange", "orange" },
{ "yellow", "yellow"},
{ "green", "dark_green"},
{ "blue", "blue"},
{ "violet", "violet"},
{ "pink", "pink"},
{ "darkgrey", "dark_grey"},
{ "brown", "brown" },
}
minetest.register_craft( {
output = "homedecor:bed_regular",
recipe = {

View File

@ -16,8 +16,6 @@ end
local S = homedecor_i18n.gettext
local function N_(x) return x end
local materials = {
{ S("brass"), "brass" },
{ S("wrought iron"), "wrought_iron" },

View File

@ -32,16 +32,6 @@ for _, t in ipairs(table_colors) do
})
end
local chaircolors = {
{ "", S("plain") },
{ "black", S("black") },
{ "red", S("red") },
{ "pink", S("pink") },
{ "violet", S("violet") },
{ "blue", S("blue") },
{ "dark_green", S("dark green") },
}
local kc_cbox = {
type = "fixed",
fixed = { -0.3125, -0.5, -0.3125, 0.3125, 0.5, 0.3125 },
@ -93,7 +83,6 @@ homedecor.register("kitchen_chair_padded", {
after_place_node = homedecor.fix_rotation_nsew,
after_dig_node = unifieddyes.after_dig_node,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local itemname = itemstack:get_name()
pos.y = pos.y+0 -- where do I put my ass ?
homedecor.sit(pos, node, clicker)
return itemstack
@ -200,7 +189,7 @@ minetest.register_lbm({
color = "dark_grey"
end
paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, "wallmounted")
paletteidx = unifieddyes.getpaletteidx("unifieddyes:"..color, "wallmounted")
end
local old_fdir = math.floor(node.param2 % 32)

View File

@ -230,18 +230,9 @@ function homedecor.bed_expansion(pos, placer, itemstack, pointed_thing, trybunks
end
local toppos = {x=pos.x, y=pos.y+1.0, z=pos.z}
local botpos = {x=pos.x, y=pos.y-1.0, z=pos.z}
local topposfwd = {x=toppos.x+fxd, y=toppos.y, z=toppos.z+fzd}
local topnodefwd = minetest.get_node(topposfwd)
local topnode = minetest.get_node(toppos)
local bottomnode = minetest.get_node(botpos)
print(topnode.name, thisnode.name, bottomnode.name, itemstack:get_name(), dump(trybunks))
if trybunks and is_buildable_to(placer_name, toppos, topposfwd) then
print("want to stack beds, top seems to be clear")
local newname = string.gsub(thisnode.name, "_regular", "_extended")
minetest.set_node(toppos, { name = thisnode.name, param2 = fdir})
minetest.set_node(pos, { name = newname, param2 = fdir})

View File

@ -1,13 +1,7 @@
-- This file supplies glowlights
local dirs2 = { 9, 18, 7, 12 }
local S = homedecor_i18n.gettext
local function N_(x) return x end
local colors = { N_("yellow"), N_("white") }
local glowlight_nodebox = {
half = homedecor.nodebox.slab_y(1/2),
quarter = homedecor.nodebox.slab_y(1/4),
@ -579,7 +573,7 @@ minetest.register_lbm({
end
local lampname
if string.find(name, "standing_lamp") then
if string.find(name, "standing_lamp") then
lampname = "homedecor:standing_lamp"
elseif string.find(name, "table_lamp") then
lampname = "homedecor:table_lamp"
@ -617,7 +611,6 @@ minetest.register_lbm({
local paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, false)
local old_node = node.name
local old_fdir
local new_node = newname
local new_fdir = 1
@ -668,7 +661,6 @@ minetest.register_lbm({
nodenames = homedecor.old_static_desk_lamps,
action = function(pos, node)
local name = node.name
local newname
local color = string.sub(name, string.find(name, "_", -8) + 1)
if color == "green" then

View File

@ -4,7 +4,7 @@ local S = homedecor_i18n.gettext
-- Various kinds of tables
local materials = {
{ "glass",
{ "glass",
S("Small square glass table"),
S("Small round glass table"),
S("Large glass table piece"),

View File

@ -1,8 +1,6 @@
local S = homedecor_i18n.gettext
local function N_(x) return x end
homedecor.register("window_quartered", {
description = S("Window (quartered)"),
tiles = {
@ -117,7 +115,6 @@ minetest.register_node("homedecor:curtain_closed", {
after_dig_node = unifieddyes.after_dig_node,
after_place_node = homedecor.fix_rotation,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local itemname = itemstack:get_name()
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
if string.find(topnode.name, "homedecor:curtainrod") then
-- Open the curtains
@ -144,7 +141,6 @@ minetest.register_node("homedecor:curtain_open", {
after_dig_node = unifieddyes.after_dig_node,
after_place_node = homedecor.fix_rotation,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local itemname = itemstack:get_name()
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
if string.find(topnode.name, "homedecor:curtainrod") then
-- Close the curtains
@ -216,18 +212,17 @@ homedecor.register("stained_glass", {
-- Convert old curtain nodes to param2-colorization
local curtaincolors = {
{ N_("red"), "ad2323" },
{ N_("green"), "27a927" },
{ N_("blue"), "2626c6" },
{ N_("white"), "ffffff" },
{ N_("pink"), "ff8fb7" },
{ N_("violet"), "7f29d7" },
"red",
"green",
"blue",
"white",
"pink",
"violet",
}
homedecor.old_static_curtain_nodes = {}
for _, i in ipairs(curtaincolors) do
local color,hue = unpack(i)
for _, color in ipairs(curtaincolors) do
table.insert(homedecor.old_static_curtain_nodes, "homedecor:curtain_"..color)
table.insert(homedecor.old_static_curtain_nodes, "homedecor:curtain_open_"..color)
end

View File

@ -34,7 +34,6 @@ minetest.register_node("lavalamp:lavalamp", {
sounds = default.node_sound_glass_defaults(),
after_dig_node = unifieddyes.after_dig_node,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local itemname = itemstack:get_name()
node.name = "lavalamp:lavalamp_off"
minetest.swap_node(pos, node)
return itemstack
@ -102,7 +101,6 @@ minetest.register_lbm({
nodenames = lavalamp.old_static_nodes,
action = function(pos, node)
local name = node.name
local newname
local color
if string.find(name, "red") then

View File

@ -13,7 +13,7 @@ minetest.register_node("lrfurn:armchair", {
drawtype = "mesh",
mesh = "lrfurn_armchair.obj",
tiles = {
"lrfurn_upholstery.png",
"lrfurn_upholstery.png",
{ name = "lrfurn_sofa_bottom.png", color = 0xffffffff }
},
paramtype = "light",
@ -26,7 +26,6 @@ minetest.register_node("lrfurn:armchair", {
after_place_node = lrfurn.fix_rotation,
after_dig_node = unifieddyes.after_dig_node,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local itemname = itemstack:get_name()
if not clicker:is_player() then
return itemstack
end

View File

@ -1,6 +1,4 @@
local S = homedecor_i18n.gettext
lrfurn = {}
screwdriver = screwdriver or {}

View File

@ -39,7 +39,6 @@ minetest.register_node("lrfurn:longsofa", {
end,
after_dig_node = unifieddyes.after_dig_node,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local itemname = itemstack:get_name()
if not clicker:is_player() then
return itemstack
end

View File

@ -39,7 +39,6 @@ minetest.register_node("lrfurn:sofa", {
end,
after_dig_node = unifieddyes.after_dig_node,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local itemname = itemstack:get_name()
if not clicker:is_player() then
return itemstack
end