Fix player skin changing code.
authorkaeza <kaeza@users.sf.net>
Sat, 7 Dec 2013 01:06:45 +0000 (23:06 -0200)
committerShadowNinja <noreply@gmail.com>
Sat, 7 Dec 2013 03:45:17 +0000 (22:45 -0500)
mods/default/player.lua

index cad11059b5e7c3c27cf638cf623ea6851472bd88..d7426d8eb43d0b2a14c75ace98f9458a99c2676d 100644 (file)
@@ -143,6 +143,13 @@ minetest.register_on_joinplayer(function(player)
        default.player_set_model(player, "character.x")
 end)
 
+minetest.register_on_leaveplayer(function(player)
+       local name = player:get_player_name()
+       player_model[name] = nil
+       player_anim[name] = nil
+       player_textures[name] = nil
+end)
+
 -- Localize for better performance.
 local player_set_animation = default.player_set_animation