mirror of
https://github.com/mt-mods/controls.git
synced 2024-11-27 17:13:44 +01:00
add luacheck
This commit is contained in:
parent
81c651b571
commit
64bf138eee
16
.luacheckrc
Normal file
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"
|
||||
}
|
18
init.lua
18
init.lua
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user