Player API: Apply model default textures when passing nil to 'set_textures'
This commit is contained in:
parent
c41621092d
commit
4aebd3639b
6
api.lua
6
api.lua
@ -58,8 +58,10 @@ end
|
|||||||
|
|
||||||
function player_api.set_textures(player, textures)
|
function player_api.set_textures(player, textures)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
player_textures[name] = textures
|
local model = models[player_model[name]]
|
||||||
player:set_properties({textures = textures,})
|
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
|
end
|
||||||
|
|
||||||
function player_api.set_animation(player, anim_name, speed)
|
function player_api.set_animation(player, anim_name, speed)
|
||||||
|
Loading…
Reference in New Issue
Block a user