Merge pull request #2745 from InspectorCaracal/schedule-script-fixes
Schedule and Global Script fixes
This commit is contained in:
commit
668720a4c4
3 changed files with 6 additions and 4 deletions
|
|
@ -328,4 +328,4 @@ class GametimeScript(DefaultScript):
|
||||||
callback()
|
callback()
|
||||||
|
|
||||||
seconds = real_seconds_until(**self.db.gametime)
|
seconds = real_seconds_until(**self.db.gametime)
|
||||||
self.restart(interval=seconds)
|
self.start(interval=seconds,force_restart=True)
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,6 @@ class GlobalScriptContainer(Container):
|
||||||
|
|
||||||
# store a hash representation of the setup
|
# store a hash representation of the setup
|
||||||
script.attributes.add("_global_script_settings", compare_hash, category="settings_hash")
|
script.attributes.add("_global_script_settings", compare_hash, category="settings_hash")
|
||||||
script.start()
|
|
||||||
|
|
||||||
return script
|
return script
|
||||||
|
|
||||||
|
|
@ -183,9 +182,12 @@ class GlobalScriptContainer(Container):
|
||||||
# populate self.typeclass_storage
|
# populate self.typeclass_storage
|
||||||
self.load_data()
|
self.load_data()
|
||||||
|
|
||||||
# start registered scripts
|
# make sure settings-defined scripts are loaded
|
||||||
for key in self.loaded_data:
|
for key in self.loaded_data:
|
||||||
self._load_script(key)
|
self._load_script(key)
|
||||||
|
# start all global scripts
|
||||||
|
for script in self._get_scripts():
|
||||||
|
script.start()
|
||||||
|
|
||||||
def load_data(self):
|
def load_data(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ class TimeScript(DefaultScript):
|
||||||
callback(*args, **kwargs)
|
callback(*args, **kwargs)
|
||||||
|
|
||||||
seconds = real_seconds_until(**self.db.gametime)
|
seconds = real_seconds_until(**self.db.gametime)
|
||||||
self.restart(interval=seconds)
|
self.start(interval=seconds,force_restart=True)
|
||||||
|
|
||||||
|
|
||||||
# Access functions
|
# Access functions
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue