Fix crash in wieldview

This commit is contained in:
Lizzy Fleckenstein 2021-04-06 15:59:59 +02:00
parent 83b9cf3ad2
commit 1d587b8895
1 changed files with 4 additions and 0 deletions

View File

@ -70,6 +70,10 @@ minetest.register_on_joinplayer(function(player)
local name = player:get_player_name()
wieldview.wielded_item[name] = ""
minetest.after(0, function(player)
-- if the player left :is_player() will return nil
if not player:is_player() then
return
end
wieldview:update_wielded_item(player)
local itementity = minetest.add_entity(player:get_pos(), "wieldview:wieldnode")
itementity:set_attach(player, "Hand_Right", vector.new(0, 1, 0), vector.new(90, 0, 45))