Changed order of Script save. This avoids a race condition where Scripts that die very quickly tries to delete themselves before having had time to save first. Resolves #597.
This commit is contained in:
parent
0fa601f135
commit
1bcd9abc6b
1 changed files with 5 additions and 1 deletions
|
|
@ -305,11 +305,15 @@ def create_script(typeclass, key=None, obj=None, player=None, locks=None,
|
||||||
if persistent is not None:
|
if persistent is not None:
|
||||||
new_script.persistent = persistent
|
new_script.persistent = persistent
|
||||||
|
|
||||||
|
# must do this before starting the script since some
|
||||||
|
# scripts may otherwise run for a very short time and
|
||||||
|
# try to delete itself before we have a time to save it.
|
||||||
|
new_db_script.save()
|
||||||
|
|
||||||
# a new created script should usually be started.
|
# a new created script should usually be started.
|
||||||
if autostart:
|
if autostart:
|
||||||
new_script.start()
|
new_script.start()
|
||||||
|
|
||||||
new_db_script.save()
|
|
||||||
return new_script
|
return new_script
|
||||||
#alias
|
#alias
|
||||||
script = create_script
|
script = create_script
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue