Made changes to examine command (to also display SessionCmdSet) and also made some more fixes.

This commit is contained in:
Griatch 2013-11-12 21:39:15 +01:00
parent 0ea57f33a9
commit 30b7d2a405
2 changed files with 4 additions and 1 deletions

View file

@ -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)

View file

@ -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")])