Skip to content

Commit

Permalink
Player API: Apply model default textures when passing nil to 'set_tex…
Browse files Browse the repository at this point in the history
…tures'
  • Loading branch information
danielmeek32 authored and paramat committed Aug 6, 2017
1 parent 5d19fd6 commit 271b2be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mods/player_api/api.lua
Expand Up @@ -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)
Expand Down

0 comments on commit 271b2be

Please sign in to comment.