summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
authorbell07 <web.alexander@web.de>2018-01-07 20:38:34 +0100
committerGitHub <noreply@github.com>2018-01-07 20:38:34 +0100
commitc6ee5c2d5bcf17f83ceee72c3da773b8e9090e20 (patch)
tree62aefa088bc11b5b75968e3c8134edcd1a6ea940 /api.lua
parent71e05bbd6863ca91db16c386c671da77e8f9e9eb (diff)
parent6a09746b903d63302d9dd339877bf450adb3a52c (diff)
Merge pull request #2 from bell07/pr_private_skins
Rework private skins handling
Diffstat (limited to 'api.lua')
-rw-r--r--api.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/api.lua b/api.lua
index 549e79e..d822005 100644
--- a/api.lua
+++ b/api.lua
@@ -7,18 +7,19 @@ end
-- Assign skin to player
function skins.assign_player_skin(player, skin)
local skin_obj
- local skin_key
if type(skin) == "string" then
skin_obj = skins.get(skin) or skins.get(skins.default)
else
skin_obj = skin
end
- skin_key = skin_obj:get_key()
- if skin_key == skins.default then
- skin_key = ""
+ if skin_obj:is_applicable_for_player(player:get_player_name()) then
+ local skin_key = skin_obj:get_key()
+ if skin_key == skins.default then
+ skin_key = ""
+ end
+ player:set_attribute("skinsdb:skin_key", skin_key)
end
- player:set_attribute("skinsdb:skin_key", skin_key)
end
-- update visuals