mirror of
https://github.com/mt-mods/controls.git
synced 2024-11-24 07:33:43 +01:00
syntactic sugar
This commit is contained in:
parent
4fcf0345b6
commit
6a768acfde
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