try to fix quest block bug

This commit is contained in:
cale 2016-02-28 10:27:12 +01:00
parent cd20ae2e50
commit 4f316b8930
2 changed files with 4 additions and 3 deletions

View File

@ -129,8 +129,6 @@ minetest.register_node("quests:quest_block", {
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
local meta = minetest.get_meta(pos)
print(itemstack)
print(itemstack:to_table())
if not itemstack or not itemstack:to_table() then
return
end

View File

@ -42,7 +42,10 @@ function xp.add_lvl(player)
end
minetest.register_on_joinplayer(function(player)
if xp.player_xp[player:get_player_name()] then
if not player then
return
end
if xp.player_xp[player:get_player_name()] and xp.player_levels[player:get_player_name()] then
xp.xp_hud[player:get_player_name()] = player:hud_add({
hud_elem_type = "statbar",
position = {x=0.5,y=1.0},