diff options
author | bell07 <web.alexander@web.de> | 2018-01-07 20:38:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-07 20:38:34 +0100 |
commit | c6ee5c2d5bcf17f83ceee72c3da773b8e9090e20 (patch) | |
tree | 62aefa088bc11b5b75968e3c8134edcd1a6ea940 /api.lua | |
parent | 71e05bbd6863ca91db16c386c671da77e8f9e9eb (diff) | |
parent | 6a09746b903d63302d9dd339877bf450adb3a52c (diff) |
Merge pull request #2 from bell07/pr_private_skins
Rework private skins handling
Diffstat (limited to 'api.lua')
-rw-r--r-- | api.lua | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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 |