blockgame/mods/bg_player/util_misc.lua

21 lines
377 B
Lua
Raw Normal View History

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,
}