mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Avoid negative health bar color. Resolves #1751.
This commit is contained in:
parent
db4c33d539
commit
9fdd62fda3
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue