//speed: fix crash when pova isn't installed

stupid bug in weac.{player_get_physics_override,player_set_physics_override}, as you might have suspected
This commit is contained in:
Starbeamrainbowlabs 2024-01-01 22:24:49 +00:00
parent c1fce81bc3
commit abe66cf1c5
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -45,7 +45,7 @@ function wea_c.player_get_physics_override(player, purpose_str)
if minetest.global_exists("pova") then if minetest.global_exists("pova") then
return pova.get_override(player:get_player_name(), purpose_str) return pova.get_override(player:get_player_name(), purpose_str)
else else
return minetest.get_physics_override(player:get_player_name()) return player:get_physics_override()
end end
end end
@ -53,7 +53,6 @@ function wea_c.player_set_physics_override(player, purpose_str, overrides)
if type(player) == "string" then if type(player) == "string" then
player = minetest.get_player_by_name(player) player = minetest.get_player_by_name(player)
end end
local player_name = player:get_player_name()
if minetest.global_exists("pova") then if minetest.global_exists("pova") then
local overrides_old = wea_c.player_get_physics_override(player, purpose_str) local overrides_old = wea_c.player_get_physics_override(player, purpose_str)
@ -74,7 +73,7 @@ function wea_c.player_set_physics_override(player, purpose_str, overrides)
end end
pova.do_override(player) pova.do_override(player)
else else
minetest.set_physics_override(player_name, overrides) player:set_physics_override(overrides)
end end
end end