From c18bfe7388c18efa1165505093895cb344815fdf Mon Sep 17 00:00:00 2001 From: Vincent Le Goff Date: Tue, 14 Feb 2017 13:04:34 -0800 Subject: [PATCH] Update the time-sensitive script Since the game time doesn't drift much anymore, the script doesn't need to restart on startup. The restart on repeat is kept, small drifts could accumulate otherwise. --- evennia/contrib/convert_gametime.py | 15 --------------- evennia/scripts/scripts.py | 4 ---- 2 files changed, 19 deletions(-) diff --git a/evennia/contrib/convert_gametime.py b/evennia/contrib/convert_gametime.py index 24a2e3db8..c44cc64b7 100644 --- a/evennia/contrib/convert_gametime.py +++ b/evennia/contrib/convert_gametime.py @@ -266,13 +266,6 @@ class GametimeScript(DefaultScript): self.start_delay = True self.persistent = True - def at_start(self): - """The script is started or restarted.""" - if self.db.need_reset: - self.db.need_reset = False - seconds = real_seconds_until(**self.db.gametime) - self.restart(interval=seconds) - def at_repeat(self): """Call the callback and reset interval.""" callback = self.db.callback @@ -281,11 +274,3 @@ class GametimeScript(DefaultScript): seconds = real_seconds_until(**self.db.gametime) self.restart(interval=seconds) - - def at_server_reload(self): - """The server is about to reload. Put the script in need of reset.""" - self.db.need_reset = True - - def at_server_shutdown(self): - """The server is about to shutdown. Put the script in need of reset.""" - self.db.need_reset = True diff --git a/evennia/scripts/scripts.py b/evennia/scripts/scripts.py index 08a8d4fb0..6764b2e7a 100644 --- a/evennia/scripts/scripts.py +++ b/evennia/scripts/scripts.py @@ -170,10 +170,6 @@ class DefaultScript(ScriptBase): """ - if self.ndb._task and self.ndb._task.running: - # The task already exists, doesn't start it again - return - self.ndb._task = ExtendedLoopingCall(self._step_task) if self.db._paused_time: