summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/api.lua b/api.lua
index d1fd10b..add2fa8 100644
--- a/api.lua
+++ b/api.lua
@@ -2,6 +2,10 @@
local storage = minetest.get_mod_storage()
function skins.get_player_skin(player)
+ if player:get_attribute("skinsdb:skin_key") then
+ storage:set_string(player:get_player_name(), player:get_attribute("skinsdb:skin_key"))
+ player:set_attribute("skinsdb:skin_key", nil)
+ end
local skin = storage:get_string(player:get_player_name())
return skins.get(skin) or skins.get(skins.default)
end