Fix nil variable in after function

This commit is contained in:
metalstache 2013-07-19 23:22:23 -04:00
parent ba5806c329
commit b0f3db9328

View File

@ -59,7 +59,7 @@ minetest.register_on_joinplayer(function(player)
specialties.players[name].skills = {} specialties.players[name].skills = {}
specialties.players[name].skills = specialties.readXP(name) specialties.players[name].skills = specialties.readXP(name)
specialties.players[name].hud = {} specialties.players[name].hud = {}
minetest.after(0.5, function() minetest.after(0.5, function(name)
local Yoffset = 0.02 local Yoffset = 0.02
local y = 0 local y = 0
for skill,num in pairs(specialties.players[name].skills) do for skill,num in pairs(specialties.players[name].skills) do
@ -82,7 +82,8 @@ minetest.register_on_joinplayer(function(player)
}) })
y = y+Yoffset y = y+Yoffset
end end
end) end,
name)
end) end)
local function show_formspec(name, specialty) local function show_formspec(name, specialty)
minetest.show_formspec(name, "specialties:spec", get_specialInfo(name, specialty)) minetest.show_formspec(name, "specialties:spec", get_specialInfo(name, specialty))