mirror of
https://github.com/mt-mods/hangglider.git
synced 2025-01-09 17:50:23 +01:00
Optimize remove_physics_overrides()
a bit (#19)
This commit is contained in:
parent
3e304e3e5d
commit
49a878aa03
8
init.lua
8
init.lua
@ -71,12 +71,12 @@ local function set_physics_overrides(player, overrides)
|
||||
end
|
||||
|
||||
local function remove_physics_overrides(player)
|
||||
for _, name in pairs({"jump", "speed", "gravity"}) do
|
||||
if has_player_monoids then
|
||||
if has_player_monoids then
|
||||
for _, name in pairs({"jump", "speed", "gravity"}) do
|
||||
player_monoids[name]:del_change(player, "hangglider:glider")
|
||||
else
|
||||
player:set_physics_override({[name] = 1})
|
||||
end
|
||||
else
|
||||
player:set_physics_override({jump = 1, speed = 1, gravity = 1})
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user