From 2ba0f4262823f41454386750cd2a97dd55edaecd Mon Sep 17 00:00:00 2001 From: Griatch Date: Tue, 3 Aug 2021 22:25:31 +0200 Subject: [PATCH] Properly remove cmds with auto_help=False from index. Resolve #2452. --- evennia/commands/default/help.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/evennia/commands/default/help.py b/evennia/commands/default/help.py index 3589001245..707e17d13c 100644 --- a/evennia/commands/default/help.py +++ b/evennia/commands/default/help.py @@ -334,11 +334,15 @@ class CmdHelp(COMMAND_DEFAULT_CLASS): bool: If command should be listed or not. Notes: - By default, the 'view' lock will be checked, and if no such lock is defined, the 'read' + The `.auto_help` propery is checked for commands. For all help entries, + the 'view' lock will be checked, and if no such lock is defined, the 'read' lock will be used. If neither lock is defined, the help entry is assumed to be accessible to all. """ + if hasattr(cmd_or_topic, "auto_help") and not cmd_or_topic.auto_help: + return False + has_view = ( "view:" in cmd_or_topic.locks if inherits_from(cmd_or_topic, "evennia.commands.command.Command")