Skip to content

Commit 271b2be

Browse files
danielmeek32paramat
authored andcommitted
Player API: Apply model default textures when passing nil to 'set_textures'
1 parent 5d19fd6 commit 271b2be

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mods/player_api/api.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ end
5858

5959
function player_api.set_textures(player, textures)
6060
local name = player:get_player_name()
61-
player_textures[name] = textures
62-
player:set_properties({textures = textures,})
61+
local model = models[player_model[name]]
62+
local model_textures = model and model.textures or nil
63+
player_textures[name] = textures or model_textures
64+
player:set_properties({textures = textures or model_textures,})
6365
end
6466

6567
function player_api.set_animation(player, anim_name, speed)

0 commit comments

Comments
 (0)