Tweak lock names to teleport/teleport_here instead

This commit is contained in:
Griatch 2021-10-31 23:48:05 +01:00
parent fc3bf04fd8
commit b94dcbee70
2 changed files with 11 additions and 9 deletions

View file

@ -106,8 +106,8 @@ Up requirements to Django 3.2+, Twisted 21+
- Change `settings.COMMAND_DEFAULT_ARG_REGEX` default from `None` to a regex meaning that
a space or `/` must separate the cmdname and args. This better fits common expectations.
- Add confirmation question to `ban`/`unban` commands.
- Add `move` and `move_here` to `tel` command to optionally allow to limit
teleportation of an object or to a specific destination.
- Check new `teleport` and `teleport_here` lock-types in `teleport` command to optionally
allow to limit teleportation of an object or to a specific destination.
### Evennia 0.9.5 (2019-2020)

View file

@ -3357,9 +3357,9 @@ class CmdTeleport(COMMAND_DEFAULT_CLASS):
Teleports an object somewhere. If no object is given, you yourself are
teleported to the target location.
To lock an object from being teleported, set its `move` lock, it will be
To lock an object from being teleported, set its `teleport` lock, it will be
checked with the caller. To block
a destination from being teleported to, set the destination's `move_here`
a destination from being teleported to, set the destination's `teleport_here`
lock - it will be checked with the thing being teleported. Admins and
higher permissions can always teleport.
@ -3444,14 +3444,16 @@ class CmdTeleport(COMMAND_DEFAULT_CLASS):
caller.msg("%s is already at %s." % (obj_to_teleport, destination))
return
# check any move-locks
if not (caller.permissions.check("Admin") or obj_to_teleport.access(caller, "move")):
caller.msg(f"{obj_to_teleport} 'move'-lock blocks you from teleporting it anywhere.")
# check any locks
if not (caller.permissions.check("Admin") or obj_to_teleport.access(caller, "teleport")):
caller.msg(f"{obj_to_teleport} 'teleport'-lock blocks you from teleporting "
"it anywhere.")
return
if not (caller.permissions.check("Admin")
or destination.access(obj_to_teleport, "move_here")):
caller.msg(f"{destination} 'move_to'-lock blocks {obj_to_teleport} from moving there.")
or destination.access(obj_to_teleport, "teleport_here")):
caller.msg(f"{destination} 'teleport_here'-lock blocks {obj_to_teleport} from "
"moving there.")
return
# try the teleport