blockgame/mods/bg_player/step_height.lua
trans_soup 1aecdeb752 refactor: create general player interface.
create utility function for acting on player properties, and refactor
code for running and step height to make use of this.
2023-10-13 08:48:11 +02:00

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)