Don't crash when showing HUD to offline player
This makes the API more consistent with the formspec one
This commit is contained in:
parent
057d6ab4e3
commit
2235213e02
1
init.lua
1
init.lua
|
@ -320,6 +320,7 @@ local z_indexes = {}
|
||||||
function hud_fs.show_hud(player, formname, formspec)
|
function hud_fs.show_hud(player, formname, formspec)
|
||||||
if type(player) == "string" then
|
if type(player) == "string" then
|
||||||
player = minetest.get_player_by_name(player)
|
player = minetest.get_player_by_name(player)
|
||||||
|
if not player then return end
|
||||||
end
|
end
|
||||||
|
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
|
|
Loading…
Reference in New Issue