Merge branch 'master' into dropped

This commit is contained in:
wsor4035 2023-12-03 16:38:32 -05:00 committed by GitHub
commit f825331bb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -61,14 +61,14 @@ minetest.register_globalstep(function(dtime)
for _, callback in pairs(controls.registered_on_press) do
callback(player, key)
end
controls.players[pname][key] = {true, os.clock()}
controls.players[pname][key] = {true, minetest.get_us_time()}
elseif key_status and controls.players[pname][key][1] then
for _, callback in pairs(controls.registered_on_hold) do
callback(player, key, os.clock() - controls.players[pname][key][2])
callback(player, key, (minetest.get_us_time() - controls.players[pname][key][2]) / 1e6)
end
elseif not key_status and controls.players[pname][key][1] then
for _, callback in pairs(controls.registered_on_release) do
callback(player, key, os.clock() - controls.players[pname][key][2])
callback(player, key, (minetest.get_us_time() - controls.players[pname][key][2]) / 1e6)
end
controls.players[pname][key] = {false}
end