1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-08 11:30:21 +01:00

fix crash if not player

This commit is contained in:
crabman77 2015-08-10 23:52:20 +02:00
parent 399ece08b6
commit e447b010ce

View File

@ -95,6 +95,7 @@ local function tick()
minetest.after(1, tick) minetest.after(1, tick)
for playername,hudids in pairs(inventory_icon.hudids) do for playername,hudids in pairs(inventory_icon.hudids) do
local player = minetest.get_player_by_name(playername) local player = minetest.get_player_by_name(playername)
if player then
local occupied, size = inventory_icon.get_inventory_state(player:get_inventory(), "main") local occupied, size = inventory_icon.get_inventory_state(player:get_inventory(), "main")
local icon, color local icon, color
if occupied >= size then if occupied >= size then
@ -132,5 +133,6 @@ local function tick()
end end
end end
end end
end
tick() tick()