1aecdeb752
create utility function for acting on player properties, and refactor code for running and step height to make use of this.
9 lines
283 B
Lua
9 lines
283 B
Lua
local utils = load_file("util_misc")
|
|
|
|
minetest.register_globalstep(function(delta_time)
|
|
for _, player in pairs(minetest.get_connected_players()) do
|
|
utils.handle_player(player, function (_, data)
|
|
data.properties.stepheight = data.control.sneak and 0.01 or 1.05
|
|
end)
|
|
end
|
|
end)
|