player_api: Fix crash for players without model

This commit is contained in:
Lars Mueller 2022-03-13 00:00:28 +01:00
parent 0ad8222b97
commit d294ef757e

View File

@ -182,7 +182,7 @@ minetest.register_globalstep(function()
for _, player in pairs(minetest.get_connected_players()) do
local name = player:get_player_name()
local player_data = players[name]
local model = models[player_data.model]
local model = player_data and models[player_data.model]
if model and not player_attached[name] then
local controls = player:get_player_control()
local animation_speed_mod = model.animation_speed or 30