chillmeter: make decay work properly with negative chill level
parent
dd0ade6136
commit
213b83871d
|
@ -67,8 +67,12 @@ def measure(phenny, input):
|
||||||
now = time.time()
|
now = time.time()
|
||||||
if now - measure.last_tick > 60:
|
if now - measure.last_tick > 60:
|
||||||
measure.last_tick = now
|
measure.last_tick = now
|
||||||
chill -= chill_decay_rate
|
if chill > 0:
|
||||||
chill = max(0, chill)
|
chill -= chill_decay_rate
|
||||||
|
chill = max(0, chill)
|
||||||
|
elif chill < 0:
|
||||||
|
chill += chill_decay_rate
|
||||||
|
chill = min(0, chill)
|
||||||
measure.channels[input.sender] = chill
|
measure.channels[input.sender] = chill
|
||||||
|
|
||||||
if ".chill" in input:
|
if ".chill" in input:
|
||||||
|
|
Loading…
Reference in New Issue