mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
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()
|
||||
|
||||
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
|
||||
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):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue