Fix crash for invalid player object
parent
ec05529344
commit
5ecf600fda
8
init.lua
8
init.lua
|
@ -179,7 +179,13 @@ local function normalize_rotation(euler_rotation)
|
||||||
end
|
end
|
||||||
|
|
||||||
function handle_player_animations(dtime, player)
|
function handle_player_animations(dtime, player)
|
||||||
local mesh = player:get_properties().mesh
|
local props = player:get_properties()
|
||||||
|
if not props then
|
||||||
|
-- HACK inside on_joinplayer, the player object may be invalid
|
||||||
|
-- causing get_properties() to return nothing - just ignore this
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local mesh = props.mesh
|
||||||
local model = models[mesh]
|
local model = models[mesh]
|
||||||
if not model then
|
if not model then
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue