Avoid negative health bar color. Resolves #1751.

This commit is contained in:
Griatch 2019-02-23 22:10:12 +01:00
parent db4c33d539
commit 9fdd62fda3

View file

@ -90,7 +90,7 @@ def display_meter(cur_value, max_value,
# Pick which fill color to use based on how full the bar is
fillcolor_index = (float(len(fill_color)) * percent_full)
fillcolor_index = int(round(fillcolor_index)) - 1
fillcolor_index = max(0, int(round(fillcolor_index)) - 1)
fillcolor_code = "|[" + fill_color[fillcolor_index]
# Make color codes for empty bar portion and text_color