summaryrefslogtreecommitdiff
path: root/skin_meta_api.lua
diff options
context:
space:
mode:
authorAlexander Weber <web.alexander@web.de>2018-01-07 14:50:22 +0100
committerAlexander Weber <web.alexander@web.de>2018-01-07 14:50:22 +0100
commit7df6363aa0247068205a09815721164813849b19 (patch)
tree838b88f355c0c50aacea7fc7e00589a9eb9f9886 /skin_meta_api.lua
parent71e05bbd6863ca91db16c386c671da77e8f9e9eb (diff)
Rework private skins handling
-add skin:is_applicable_for_player(playername) method - hide private skins in unified_inventory since not supported - check player assignment in skins.assign_player_skin() + inherited to skins.set_player_skin()
Diffstat (limited to 'skin_meta_api.lua')
-rw-r--r--skin_meta_api.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/skin_meta_api.lua b/skin_meta_api.lua
index 5219e1d..1e3bd99 100644
--- a/skin_meta_api.lua
+++ b/skin_meta_api.lua
@@ -69,3 +69,8 @@ function skin_class:set_skin(player)
textures = {self:get_texture()},
})
end
+
+function skin_class:is_applicable_for_player(playername)
+ local assigned_player = self:get_meta("playername")
+ return not assigned_player or assigned_player == playername
+end