Second candidate fix for https://github.com/evennia/evennia/issues/2039\#issue-555828740
This commit is contained in:
parent
cff07bd8d5
commit
bc8a1320d7
1 changed files with 1 additions and 5 deletions
|
|
@ -136,12 +136,9 @@ class ExtendedLoopingCall(LoopingCall):
|
||||||
the task is not running.
|
the task is not running.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if self.running:
|
if self.running and self.interval > 0:
|
||||||
total_runtime = self.clock.seconds() - self.starttime
|
total_runtime = self.clock.seconds() - self.starttime
|
||||||
interval = self.start_delay or self.interval
|
interval = self.start_delay or self.interval
|
||||||
# Fairly naive ZeroDivision error bug workaround, see ticket: https://github.com/evennia/evennia/issues/2039#issue-555828740
|
|
||||||
if self.interval == 0:
|
|
||||||
self.interval = 1
|
|
||||||
return interval - (total_runtime % self.interval)
|
return interval - (total_runtime % self.interval)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
@ -586,7 +583,6 @@ it should not accept 0 at alln seconds. if `None`, will use the
|
||||||
del self.db._manual_pause
|
del self.db._manual_pause
|
||||||
del self.db._paused_callcount
|
del self.db._paused_callcount
|
||||||
# set new flags and start over
|
# set new flags and start over
|
||||||
# Avoid intervals lower than zero
|
|
||||||
if interval is not None and interval >= 0:
|
if interval is not None and interval >= 0:
|
||||||
self.interval = interval
|
self.interval = interval
|
||||||
if repeats is not None:
|
if repeats is not None:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue