projects
/
oweals
/
minetest_game.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5d19fd6
)
Player API: Apply model default textures when passing nil to 'set_textures'
author
danielmeek32
<danielmeek32@users.noreply.github.com>
Sun, 30 Jul 2017 18:18:12 +0000
(19:18 +0100)
committer
paramat
<mat.gregory@virginmedia.com>
Sun, 6 Aug 2017 00:53:53 +0000
(
01:53
+0100)
mods/player_api/api.lua
patch
|
blob
|
history
diff --git
a/mods/player_api/api.lua
b/mods/player_api/api.lua
index 9dd33eee78cebb05a054772ee5df0e6a7cb80ad3..21509210e8bf382fe0bef93af976d3cc2f6bf9aa 100644
(file)
--- 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)