Remove ability to teleport puppeted objects to a None location, as per #1304.

This commit is contained in:
Griatch 2017-04-18 18:29:11 +02:00
parent feed89257f
commit f7955340a7

View file

@ -2241,7 +2241,7 @@ class CmdTeleport(COMMAND_DEFAULT_CLASS):
switch is set, <target location> is ignored.
Note that the only way to retrieve
an object from a None location is by direct #dbref
reference.
reference. A puppeted object cannot be moved to None.
Teleports an object somewhere. If no object is given, you yourself
is teleported to the target location. """
@ -2266,19 +2266,21 @@ class CmdTeleport(COMMAND_DEFAULT_CLASS):
# teleporting to None
if not args:
obj_to_teleport = caller
caller.msg("Teleported to None-location.")
if caller.location and not tel_quietly:
caller.location.msg_contents("%s teleported into nothingness." % caller, exclude=caller)
else:
obj_to_teleport = caller.search(lhs, global_search=True)
if not obj_to_teleport:
caller.msg("Did not find object to teleport.")
return
caller.msg("Teleported %s -> None-location." % obj_to_teleport)
if obj_to_teleport.location and not tel_quietly:
obj_to_teleport.location.msg_contents("%s teleported %s into nothingness."
% (caller, obj_to_teleport),
exclude=caller)
if obj_to_teleport.has_player:
caller.msg("Cannot teleport a puppeted object "
"(%s, puppeted by %s) to a None-location." % (
obj_to_teleport.key, obj_to_teleport.player))
return
caller.msg("Teleported %s -> None-location." % obj_to_teleport)
if obj_to_teleport.location and not tel_quietly:
obj_to_teleport.location.msg_contents("%s teleported %s into nothingness."
% (caller, obj_to_teleport),
exclude=caller)
obj_to_teleport.location=None
return