From a352abc1c4d7fb2369f78a08bf382912ead81aa6 Mon Sep 17 00:00:00 2001 From: Griatch Date: Thu, 3 Jun 2021 23:25:10 +0200 Subject: [PATCH] Update obj.cmdset before examine. Resolves #2428. --- evennia/commands/default/building.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/evennia/commands/default/building.py b/evennia/commands/default/building.py index a159a67d28..1fe39cb704 100644 --- a/evennia/commands/default/building.py +++ b/evennia/commands/default/building.py @@ -2511,7 +2511,8 @@ class CmdExamine(ObjManipCommand): locks_string = " Default" output["Locks"] = locks_string # cmdsets - if not (len(obj.cmdset.all()) == 1 and obj.cmdset.current.key == "_EMPTY_CMDSET"): + if current_cmdset and not ( + len(obj.cmdset.all()) == 1 and obj.cmdset.current.key == "_EMPTY_CMDSET"): # all() returns a 'stack', so make a copy to sort. def _format_options(cmdset): @@ -2735,6 +2736,9 @@ class CmdExamine(ObjManipCommand): account = obj.account objct = obj + # this is usually handled when a command runs, but when we examine + # we may have leftover inherited cmdsets directly after a move etc. + obj.cmdset.update() # using callback to print results whenever function returns. get_and_merge_cmdsets( obj, session, account, objct, mergemode, self.raw_string