From b94dcbee70789f48d99592d665315a5f86bde90d Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 31 Oct 2021 23:48:05 +0100 Subject: [PATCH] Tweak lock names to teleport/teleport_here instead --- CHANGELOG.md | 4 ++-- evennia/commands/default/building.py | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3f5ca5999..4f645e6682 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/evennia/commands/default/building.py b/evennia/commands/default/building.py index 7ba0911c97..91c7d3ad3f 100644 --- a/evennia/commands/default/building.py +++ b/evennia/commands/default/building.py @@ -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