From 30b7d2a405e7f9087652faab6f052dbf56c15b3f Mon Sep 17 00:00:00 2001 From: Griatch Date: Tue, 12 Nov 2013 21:39:15 +0100 Subject: [PATCH] Made changes to examine command (to also display SessionCmdSet) and also made some more fixes. --- src/commands/cmdhandler.py | 1 + src/commands/default/building.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands/cmdhandler.py b/src/commands/cmdhandler.py index 4cfe78ddaf..005603178c 100644 --- a/src/commands/cmdhandler.py +++ b/src/commands/cmdhandler.py @@ -224,6 +224,7 @@ def get_and_merge_cmdsets(caller, session, player, obj, callertype, sessid=None) for cset in (cset for cset in local_obj_cmdsets if cset): cset.duplicates = cset.old_duplicates + #print "merged set:", cmdset.key returnValue(cmdset) diff --git a/src/commands/default/building.py b/src/commands/default/building.py index 94e60424de..4e37874054 100644 --- a/src/commands/default/building.py +++ b/src/commands/default/building.py @@ -1611,8 +1611,10 @@ class CmdExamine(ObjManipCommand): if not (len(obj.cmdset.all()) == 1 and obj.cmdset.current.key == "Empty"): # list the current cmdsets all_cmdsets = obj.cmdset.all() + (hasattr(obj, "player") and obj.player and obj.player.cmdset.all() or []) + all_cmdsets += hasattr(obj, "sessid") and hasattr(obj, "player") and obj.player.get_session(obj.sessid).cmdset.all() all_cmdsets.sort(key=lambda x:x.priority, reverse=True) - string += "\n{wCurrent Cmdset(s){n:\n %s" % ("\n ".join("%s (prio %s)" % (cmdset.path, cmdset.priority) for cmdset in all_cmdsets)) + string += "\n{wStored Cmdset(s){n:\n %s" % ("\n ".join("%s [%s] (prio %s)" % + (cmdset.path, cmdset.key, cmdset.priority) for cmdset in all_cmdsets)) # list the commands available to this object avail_cmdset = sorted([cmd.key for cmd in avail_cmdset if cmd.access(obj, "cmd")])