Cleaned up the code a little bit
This commit is contained in:
parent
15eafcfbb6
commit
129a797670
9
init.lua
9
init.lua
@ -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)
|
Loading…
x
Reference in New Issue
Block a user