Fix warnings in new luacheck
This commit is contained in:
parent
6b8049f1aa
commit
e3b12312e5
3 changed files with 4 additions and 3 deletions
|
@ -9,6 +9,7 @@ exclude_files = {
|
||||||
"mods/treasurer",
|
"mods/treasurer",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ignore = {"631"}
|
||||||
|
|
||||||
globals = {
|
globals = {
|
||||||
"crafting", "vector", "table", "minetest",
|
"crafting", "vector", "table", "minetest",
|
||||||
|
|
|
@ -29,7 +29,7 @@ end, {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
function table.map_inplace(t, f)
|
function table.map_inplace(t, f) -- luacheck: ignore
|
||||||
for key, value in pairs(t) do
|
for key, value in pairs(t) do
|
||||||
t[key] = f(value)
|
t[key] = f(value)
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,13 +11,13 @@ math.randomseed(os.time())
|
||||||
random_messages = {}
|
random_messages = {}
|
||||||
random_messages.messages = {} --This table contains all messages.
|
random_messages.messages = {} --This table contains all messages.
|
||||||
|
|
||||||
function table.count( t )
|
function table.count( t ) -- luacheck: ignore
|
||||||
local i = 0
|
local i = 0
|
||||||
for k in pairs( t ) do i = i + 1 end
|
for k in pairs( t ) do i = i + 1 end
|
||||||
return i
|
return i
|
||||||
end
|
end
|
||||||
|
|
||||||
function table.random( t )
|
function table.random( t ) -- luacheck: ignore
|
||||||
local rk = math.random( 1, table.count( t ) )
|
local rk = math.random( 1, table.count( t ) )
|
||||||
local i = 1
|
local i = 1
|
||||||
for k, v in pairs( t ) do
|
for k, v in pairs( t ) do
|
||||||
|
|
Loading…
Reference in a new issue