From 271b2befaacc80f4bcc63e5cdfb31cb64ff2fec9 Mon Sep 17 00:00:00 2001 From: danielmeek32 Date: Sun, 30 Jul 2017 19:18:12 +0100 Subject: [PATCH] Player API: Apply model default textures when passing nil to 'set_textures' --- mods/player_api/api.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/player_api/api.lua b/mods/player_api/api.lua index 9dd33eee..21509210 100644 --- a/mods/player_api/api.lua +++ b/mods/player_api/api.lua @@ -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)