mirror of
https://github.com/mt-mods/controls.git
synced 2024-11-09 16:43:47 +01:00
syntactic sugar
This commit is contained in:
parent
4065c68807
commit
521d68c767
2
init.lua
2
init.lua
@ -67,7 +67,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
for _, callback in pairs(controls.registered_on_hold) do
|
for _, callback in pairs(controls.registered_on_hold) do
|
||||||
callback(player, key, os.clock() - controls.players[pname][key][2])
|
callback(player, key, os.clock() - controls.players[pname][key][2])
|
||||||
end
|
end
|
||||||
elseif key_status==false and controls.players[pname][key][1]==true then
|
elseif not key_status and controls.players[pname][key][1]==true then
|
||||||
for _, callback in pairs(controls.registered_on_release) do
|
for _, callback in pairs(controls.registered_on_release) do
|
||||||
callback(player, key, os.clock() - controls.players[pname][key][2])
|
callback(player, key, os.clock() - controls.players[pname][key][2])
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user