mirror of
https://github.com/evennia/evennia.git
synced 2026-03-22 07:46:30 +01:00
Scripts and Exits updated. Fixed some deep issues with Scripts that caused object-based scripts to not properly shut down in some situations, as well as spawn multiple instances of themselves. I think this should resolve all "at_repeat doubling" issues reported. Due to optimizations in the typeclass cache loader in a previous update, the Exit cmdsets were not properly loaded (they were loaded at cache time, which now doesn't happen as often). So Exits instead rely on the new "at_cmdset_get" hook called by the cmdhandler. It allows dynamic modification of cmdsets just before they are accessed. Resolves issue173 (I hope). Resolves issue180. Resolves issue 181.
This commit is contained in:
parent
16affc284b
commit
2b4e008d18
13 changed files with 135 additions and 68 deletions
|
|
@ -91,20 +91,20 @@ def create_object(typeclass, key=None, location=None,
|
|||
player.obj = new_object
|
||||
|
||||
new_object.destination = destination
|
||||
|
||||
|
||||
# call the hook method. This is where all at_creation
|
||||
# customization happens as the typeclass stores custom
|
||||
# things on its database object.
|
||||
# things on its database object.
|
||||
new_object.basetype_setup() # setup the basics of Exits, Characters etc.
|
||||
new_object.at_object_creation()
|
||||
|
||||
# custom-given variables override the hook
|
||||
|
||||
# custom-given perms/locks overwrite hooks
|
||||
if permissions:
|
||||
new_object.permissions = permissions
|
||||
if aliases:
|
||||
new_object.aliases = aliases
|
||||
if locks:
|
||||
new_object.locks.add(locks)
|
||||
if aliases:
|
||||
new_object.aliases = aliases
|
||||
|
||||
# perform a move_to in order to display eventual messages.
|
||||
if home:
|
||||
|
|
@ -114,6 +114,10 @@ def create_object(typeclass, key=None, location=None,
|
|||
else:
|
||||
# rooms would have location=None.
|
||||
new_object.location = None
|
||||
|
||||
# post-hook setup (mainly used by Exits)
|
||||
new_object.basetype_posthook_setup()
|
||||
|
||||
new_object.save()
|
||||
return new_object
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue