diff --git a/evennia/commands/cmdhandler.py b/evennia/commands/cmdhandler.py index c88eed42a7..a4f04af016 100644 --- a/evennia/commands/cmdhandler.py +++ b/evennia/commands/cmdhandler.py @@ -272,30 +272,39 @@ def get_and_merge_cmdsets(caller, session, player, obj, callertype): except AttributeError: returnValue(((None, None, None), [])) + print "callertype:", callertype local_obj_cmdsets = [] if callertype == "session": # we are calling the command from the session level report_to = session current, cmdsets = yield _get_cmdsets(session) + print "session cmdsets:", len(cmdsets) if player: # this automatically implies logged-in pcurrent, player_cmdsets = yield _get_cmdsets(player) + print "player cmdsets:", len(player_cmdsets) cmdsets += player_cmdsets current = current + pcurrent if obj: ocurrent, obj_cmdsets = yield _get_cmdsets(obj) + print "obj_cmdsets:", len(obj_cmdsets), [cmdset.key for cmdset in obj_cmdsets] current = current + ocurrent cmdsets += obj_cmdsets if not current.no_objs: local_obj_cmdsets = yield _get_local_obj_cmdsets(obj) + print "local_obj_cmdsets:", len(local_obj_cmdsets), [cmdset.key for cmdset in local_obj_cmdsets] if current.no_exits: # filter out all exits local_obj_cmdsets = [cmdset for cmdset in local_obj_cmdsets if cmdset.key != "ExitCmdSet"] cmdsets += local_obj_cmdsets if not current.no_channels: # also objs may have channels - cmdsets += yield _get_channel_cmdset(obj) + channel_cmdsets = yield _get_channel_cmdset(obj) + print "obj channel cmdsets:", len(channel_cmdsets), [cmdset.key for cmdset in channel_cmdsets] + cmdsets += channel_cmdsets if not current.no_channels: - cmdsets += yield _get_channel_cmdset(player) + channel_cmdsets = yield _get_channel_cmdset(obj) + print "player channel cmdsets:", len(channel_cmdsets), [cmdset.key for cmdset in channel_cmdsets] + cmdsets += channel_cmdsets elif callertype == "player": # we are calling the command from the player level @@ -343,6 +352,7 @@ def get_and_merge_cmdsets(caller, session, player, obj, callertype): if cmdsets: # faster to do tuple on list than to build tuple directly mergehash = tuple([id(cmdset) for cmdset in cmdsets]) + print "len(mergehash):", len(mergehash) if mergehash in _CMDSET_MERGE_CACHE: # cached merge exist; use that cmdset = _CMDSET_MERGE_CACHE[mergehash] @@ -372,7 +382,6 @@ def get_and_merge_cmdsets(caller, session, player, obj, callertype): _CMDSET_MERGE_CACHE[mergehash] = cmdset else: cmdset = None - for cset in (cset for cset in local_obj_cmdsets if cset): cset.duplicates = cset.old_duplicates returnValue(cmdset) diff --git a/evennia/commands/default/general.py b/evennia/commands/default/general.py index 325440b213..b345199874 100644 --- a/evennia/commands/default/general.py +++ b/evennia/commands/default/general.py @@ -68,6 +68,7 @@ class CmdLook(COMMAND_DEFAULT_CLASS): target = self.caller.search(self.args) if not target: return + print "cmdlook:", id(self), id(self.cmdset) self.msg(self.caller.at_look(target)) diff --git a/evennia/utils/evmenu.py b/evennia/utils/evmenu.py index 221c9ccc89..63e6c73786 100644 --- a/evennia/utils/evmenu.py +++ b/evennia/utils/evmenu.py @@ -42,7 +42,7 @@ command definition too) with function defintions: # code return text, options - def node_with_other_namen(caller, input_string): + def node_with_other_name(caller, input_string): # code return text, options ```