mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-12-11 16:33:21 +01:00
//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:
parent
c1fce81bc3
commit
abe66cf1c5
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user