Fix image file being left open

master
kaeza 2013-01-10 02:54:46 -02:00
parent 86c976a2b0
commit f7edd74619
1 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,8 @@
minetest.register_on_joinplayer(function(player)
local filename = minetest.get_modpath("player_textures").."/textures/player_"..player:get_player_name()
if io.open(filename..".png") then
local f = io.open(filename..".png")
if f then
f:close()
player:set_properties({
textures = {"player_"..player:get_player_name()..".png"},
})