mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-20 14:23:16 -04:00
fixes
This commit is contained in:
parent
5d2834eb1f
commit
556cacf038
2 changed files with 4 additions and 4 deletions
|
@ -466,7 +466,7 @@ The player API can register player models and update the player's appearance.
|
|||
* Sets a player texture
|
||||
* `player`: PlayerRef
|
||||
* `texture`: texture filename
|
||||
* `texture_ID`: the ID of the texture to change. If nil, default is `1`
|
||||
* `index`: the index of the texture to change. If nil, default is `1`
|
||||
|
||||
* `player_api.get_animation(player)`
|
||||
* Returns a table containing fields `model`, `textures` and `animation`
|
||||
|
|
|
@ -71,10 +71,10 @@ function player_api.set_textures(player, textures)
|
|||
player:set_properties({textures = textures or model_textures})
|
||||
end
|
||||
|
||||
function player_api.set_texture(player, texture, texture_ID)
|
||||
local ID = not texture_ID and 1 or texture_ID
|
||||
function player_api.set_texture(player, texture, index)
|
||||
local new_textures = player:get_properties().textures
|
||||
new_textures[ID] = texture
|
||||
index = index or 1
|
||||
new_textures[index] = texture
|
||||
player:set_properties({textures = new_textures})
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue