summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
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