diff --git a/CHANGELOG.md b/CHANGELOG.md index 6484411f97..3a10238f47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Fix: Make sure `at_server_reload` is called also on non-repeating Scripts. - Fix: Webclient was not giving a proper error when sending an unknown outputfunc to it. - Fix: Make `py` command always send strings unless `client_raw` flag is set. +- Fix: `Script.start` with an integer `start_delay` caused a traceback. - Docs: Remove doc pages for Travis/TeamCity CI tools, they were both very much out of date, and Travis is not free for OSS anymore. - Docs: A lot fixes of typos and bugs in tutorials. diff --git a/evennia/scripts/scripts.py b/evennia/scripts/scripts.py index 7abd589c34..fcf2c76f29 100644 --- a/evennia/scripts/scripts.py +++ b/evennia/scripts/scripts.py @@ -205,7 +205,9 @@ class ScriptBase(ScriptDB, metaclass=TypeclassBase): self.db_interval = interval update_fields.append("db_interval") if start_delay is not None: - self.db_start_delay = start_delay + # note that for historical reasons, the start_delay is a boolean field, not an int; the + # actual value is only used with the task. + self.db_start_delay = bool(start_delay) update_fields.append("db_start_delay") if repeats is not None: self.db_repeats = repeats @@ -244,7 +246,9 @@ class ScriptBase(ScriptDB, metaclass=TypeclassBase): if not self.ndb._task.running: # if not unpausing started it, start script anew with the new values - self.ndb._task.start(self.db_interval, now=not self.db_start_delay) + self.ndb._task.start( + self.db_interval, now=not self.db_start_delay, start_delay=start_delay + ) self.at_start(**kwargs) @@ -547,7 +551,7 @@ class ScriptBase(ScriptDB, metaclass=TypeclassBase): Keyword Args: interval (int): How often to fire `at_repeat` in seconds. - start_delay (int): If the start of ticking should be delayed. + start_delay (int): If the start of ticking should be delayed and by how much. repeats (int): How many repeats. 0 for infinite repeats. **kwargs: Optional (default unused) kwargs passed on into the `at_start` hook.