Fix bug when hud.id is nil

When calling hudlib.change, if hud.id was nil what seemed as a random ID would be used. This caused other HUDs to completely mess up.
This commit is contained in:
octacian 2017-04-09 16:42:39 -07:00
parent bc8c64721a
commit a9cf90c790

View File

@ -243,7 +243,7 @@ function hudlib.change(player, hud_name, key, val)
local name = player:get_player_name()
local hud = hudlib.get(name, hud_name)
if hud then
if hud and hud.id then
if type(val) == allowed[key] then
player:hud_change(hud.id, key, val)
end