Changed so object.move_to() traverses exits by default - i.e. you will no longer end up INSIDE the exit object if you move_to the exit, but instead you will go to the exits destination. This should be the most common use. The use_destination keyword to object.move_to can be used to change this behaviour. Also @teleport (which uses move_to()) has gotten a new flag to allow for teleporting into exits if so specifically desired. Resolves issue 224.
This commit is contained in:
parent
464aa8ca9e
commit
bcf214ee0d
2 changed files with 11 additions and 9 deletions
|
|
@ -1831,11 +1831,12 @@ class CmdTeleport(MuxCommand):
|
|||
@tel/switch [<object> =] <location>
|
||||
|
||||
Switches:
|
||||
quiet - don't inform the source and target
|
||||
locations about the move.
|
||||
quiet - don't echo leave/arrive messages to the source/target
|
||||
locations for the move.
|
||||
intoexit - if target is an exit, teleport INTO
|
||||
the exit object instead of to its destination
|
||||
|
||||
Teleports an object somewhere. If no object is
|
||||
given we are teleporting ourselves.
|
||||
Teleports an object or yourself somewhere.
|
||||
"""
|
||||
key = "@tel"
|
||||
aliases = "@teleport"
|
||||
|
|
@ -1874,8 +1875,11 @@ class CmdTeleport(MuxCommand):
|
|||
if obj_to_teleport == destination:
|
||||
caller.msg("You can't teleport an object inside of itself!")
|
||||
return
|
||||
use_destination = True
|
||||
if "intoexit" in self.switches:
|
||||
use_destination = False
|
||||
# try the teleport
|
||||
if obj_to_teleport.move_to(destination, quiet=tel_quietly, emit_to_obj=caller):
|
||||
if obj_to_teleport.move_to(destination, quiet=tel_quietly, emit_to_obj=caller, use_destination=use_destination):
|
||||
if obj_to_teleport == caller:
|
||||
caller.msg("Teleported to %s." % destination.key)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue