add luacheck

This commit is contained in:
BuckarooBanzay 2020-04-28 08:05:06 +02:00
parent 81c651b571
commit 64bf138eee
2 changed files with 25 additions and 9 deletions

16
.luacheckrc Normal file

@ -0,0 +1,16 @@
allow_defined_top = true
globals = {
"controls",
}
read_globals = {
-- Stdlib
string = {fields = {"split"}},
table = {fields = {"copy", "getn"}},
-- Minetest
"minetest",
"vector", "ItemStack",
"dump"
}

@ -19,14 +19,14 @@ end
minetest.register_on_joinplayer(function(player)
local name = player:get_player_name()
controls.players[name] = {
jump={false},
right={false},
left={false},
LMB={false},
RMB={false},
sneak={false},
aux1={false},
down={false},
jump={false},
right={false},
left={false},
LMB={false},
RMB={false},
sneak={false},
aux1={false},
down={false},
up={false}
}
end)
@ -36,7 +36,7 @@ minetest.register_on_leaveplayer(function(player)
controls.players[name] = nil
end)
minetest.register_globalstep(function(dtime)
minetest.register_globalstep(function()
for _, player in pairs(minetest.get_connected_players()) do
local player_name = player:get_player_name()
local player_controls = player:get_player_control()