mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-04 17:40:26 +01:00
[hudbars] Patch so that server errors won't crash
This commit is contained in:
parent
a296193b91
commit
de33f83779
|
@ -209,7 +209,7 @@ function hb.change_hudbar(player, identifier, new_value, new_max_value)
|
||||||
minetest.log("error", main_error_text.."new_value ("..new_value..") is smaller than 0!")
|
minetest.log("error", main_error_text.."new_value ("..new_value..") is smaller than 0!")
|
||||||
end
|
end
|
||||||
|
|
||||||
if hudtable.hudstate[name].hidden == false then
|
if hudtable.hudstate[name] and hudtable.hudstate[name].hidden == false then
|
||||||
if max_changed then
|
if max_changed then
|
||||||
if hudtable.hudstate[name].max == 0 then
|
if hudtable.hudstate[name].max == 0 then
|
||||||
player:hud_change(hudtable.hudids[name].bg, "scale", {x=0,y=0})
|
player:hud_change(hudtable.hudids[name].bg, "scale", {x=0,y=0})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user