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

Player API: Apply model default textures when passing nil to 'set_textures'

This commit is contained in:
danielmeek32 2017-07-30 19:18:12 +01:00 committed by paramat
parent 5d19fd6923
commit 271b2befaa

View File

@ -58,8 +58,10 @@ end
function player_api.set_textures(player, textures)
local name = player:get_player_name()
player_textures[name] = textures
player:set_properties({textures = textures,})
local model = models[player_model[name]]
local model_textures = model and model.textures or nil
player_textures[name] = textures or model_textures
player:set_properties({textures = textures or model_textures,})
end
function player_api.set_animation(player, anim_name, speed)