1
0
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:
LeMagnesium 2015-11-02 19:04:07 +01:00
parent a296193b91
commit de33f83779

View File

@ -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!")
end
if hudtable.hudstate[name].hidden == false then
if hudtable.hudstate[name] and hudtable.hudstate[name].hidden == false then
if max_changed then
if hudtable.hudstate[name].max == 0 then
player:hud_change(hudtable.hudids[name].bg, "scale", {x=0,y=0})