1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-12-22 15:00:18 +01:00

player_api: Fix crash for players without model

This commit is contained in:
Lars Mueller 2022-03-13 00:00:28 +01:00 committed by Lars Müller
parent 240f9a6a85
commit a6f3b89596

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