Cleaned up the code a little bit

This commit is contained in:
orion-tux 2024-07-03 13:39:40 +02:00
parent 15eafcfbb6
commit 129a797670

View File

@ -1,17 +1,16 @@
local function check_player(player)
local function set_speed(player)
local name = player:get_player_name()
local controls = player:get_player_control()
local privs = minetest.get_player_privs(name) -- I might use this later for privs...
if controls.aux1 then
player:set_physics_override({speed = 1.8})
elseif not controls.aux1 then
player:set_physics_override({speed = 1})
elseif not controls.aux1 then
player:set_physics_override({speed = 1})
end
end
minetest.register_globalstep(function(dtime)
for _, player in ipairs(minetest.get_connected_players()) do
check_player(player)
set_speed(player)
end
end)