chillmeter: make decay work properly with negative chill level
This commit is contained in:
@@ -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
|
||||||
|
if chill > 0:
|
||||||
chill -= chill_decay_rate
|
chill -= chill_decay_rate
|
||||||
chill = max(0, chill)
|
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:
|
||||||
|
|||||||
Reference in New Issue
Block a user