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

Avoid crash with hudbars

- Solves #270
This commit is contained in:
LeMagnesium 2015-09-08 23:09:29 +02:00
parent 4a3c583194
commit faaa3afb0e

View File

@ -180,12 +180,12 @@ function hb.change_hudbar(player, identifier, new_value, new_max_value)
local hudtable = hb.get_hudtable(identifier) local hudtable = hb.get_hudtable(identifier)
local value_changed, max_changed = false, false local value_changed, max_changed = false, false
if new_value ~= nil then if new_value ~= nil and hudtable.hudstate[name] then
if new_value ~= hudtable.hudstate[name].value then if new_value ~= hudtable.hudstate[name].value then
hudtable.hudstate[name].value = new_value hudtable.hudstate[name].value = new_value
value_changed = true value_changed = true
end end
else elseif hudtable.hudstate[name] then
new_value = hudtable.hudstate[name].value new_value = hudtable.hudstate[name].value
end end
if new_max_value ~= nil then if new_max_value ~= nil then