mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Merge pull request #1349 from TehomCD/move_to_args
Add kwargs for hooks to move_to
This commit is contained in:
commit
14a7e12002
1 changed files with 7 additions and 3 deletions
|
|
@ -614,7 +614,8 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
|||
obj.msg(text=(outmessage, outkwargs), from_obj=from_obj, **kwargs)
|
||||
|
||||
def move_to(self, destination, quiet=False,
|
||||
emit_to_obj=None, use_destination=True, to_none=False, move_hooks=True):
|
||||
emit_to_obj=None, use_destination=True, to_none=False, move_hooks=True,
|
||||
**kwargs):
|
||||
"""
|
||||
Moves this object to a new location.
|
||||
|
||||
|
|
@ -635,6 +636,9 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
|||
(at_before/after_move etc) with quiet=True, this is as quiet a move
|
||||
as can be done.
|
||||
|
||||
Kwargs:
|
||||
Passed on to announce_move_to and announce_move_from hooks.
|
||||
|
||||
Returns:
|
||||
result (bool): True/False depending on if there were problems with the move.
|
||||
This method may also return various error messages to the
|
||||
|
|
@ -700,7 +704,7 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
|||
if not quiet:
|
||||
# tell the old room we are leaving
|
||||
try:
|
||||
self.announce_move_from(destination)
|
||||
self.announce_move_from(destination, **kwargs)
|
||||
except Exception as err:
|
||||
logerr(errtxt % "at_announce_move()", err)
|
||||
return False
|
||||
|
|
@ -715,7 +719,7 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
|||
if not quiet:
|
||||
# Tell the new room we are there.
|
||||
try:
|
||||
self.announce_move_to(source_location)
|
||||
self.announce_move_to(source_location, **kwargs)
|
||||
except Exception as err:
|
||||
logerr(errtxt % "announce_move_to()", err)
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue