Merge pull request #2745 from InspectorCaracal/schedule-script-fixes

Schedule and Global Script fixes
This commit is contained in:
Griatch 2022-05-27 10:58:55 +02:00 committed by GitHub
commit 668720a4c4
3 changed files with 6 additions and 4 deletions

View file

@ -328,4 +328,4 @@ class GametimeScript(DefaultScript):
callback()
seconds = real_seconds_until(**self.db.gametime)
self.restart(interval=seconds)
self.start(interval=seconds,force_restart=True)

View file

@ -167,7 +167,6 @@ class GlobalScriptContainer(Container):
# store a hash representation of the setup
script.attributes.add("_global_script_settings", compare_hash, category="settings_hash")
script.start()
return script
@ -183,9 +182,12 @@ class GlobalScriptContainer(Container):
# populate self.typeclass_storage
self.load_data()
# start registered scripts
# make sure settings-defined scripts are loaded
for key in self.loaded_data:
self._load_script(key)
# start all global scripts
for script in self._get_scripts():
script.start()
def load_data(self):
"""

View file

@ -67,7 +67,7 @@ class TimeScript(DefaultScript):
callback(*args, **kwargs)
seconds = real_seconds_until(**self.db.gametime)
self.restart(interval=seconds)
self.start(interval=seconds,force_restart=True)
# Access functions