1aecdeb752
create utility function for acting on player properties, and refactor code for running and step height to make use of this.
20 lines
377 B
Lua
20 lines
377 B
Lua
local function handle_player (player, fn)
|
|
local data = {}
|
|
|
|
data.control = player:get_player_control()
|
|
data.properties = player:get_properties()
|
|
data.physics = player:get_physics_override()
|
|
|
|
local result = fn(player, data)
|
|
|
|
player:set_properties(data.properties)
|
|
player:set_physics_override(data.physics)
|
|
|
|
return result
|
|
end
|
|
|
|
|
|
|
|
return {
|
|
handle_player = handle_player,
|
|
}
|