mirror of
https://github.com/mt-mods/controls.git
synced 2024-11-28 01:23:43 +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)
|
minetest.register_on_joinplayer(function(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
controls.players[name] = {
|
controls.players[name] = {
|
||||||
jump={false},
|
jump={false},
|
||||||
right={false},
|
right={false},
|
||||||
left={false},
|
left={false},
|
||||||
LMB={false},
|
LMB={false},
|
||||||
RMB={false},
|
RMB={false},
|
||||||
sneak={false},
|
sneak={false},
|
||||||
aux1={false},
|
aux1={false},
|
||||||
down={false},
|
down={false},
|
||||||
up={false}
|
up={false}
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
@ -36,7 +36,7 @@ minetest.register_on_leaveplayer(function(player)
|
|||||||
controls.players[name] = nil
|
controls.players[name] = nil
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function()
|
||||||
for _, player in pairs(minetest.get_connected_players()) do
|
for _, player in pairs(minetest.get_connected_players()) do
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
local player_controls = player:get_player_control()
|
local player_controls = player:get_player_control()
|
||||||
|
Loading…
Reference in New Issue
Block a user