From 15e0e479d19225ef149fc49c3bac0035a36f2555 Mon Sep 17 00:00:00 2001 From: Ahmed Charles Date: Sat, 24 Oct 2015 08:12:42 +0000 Subject: [PATCH] Fix bug in examine. Examine sorts the original stack used by the object that it examines, which is bad. --- evennia/commands/default/building.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evennia/commands/default/building.py b/evennia/commands/default/building.py index afa7fbb3e..3ef0f09e9 100644 --- a/evennia/commands/default/building.py +++ b/evennia/commands/default/building.py @@ -1910,8 +1910,8 @@ class CmdExamine(ObjManipCommand): if not (len(obj.cmdset.all()) == 1 and obj.cmdset.current.key == "_EMPTY_CMDSET"): - stored_cmdsets = obj.cmdset.all() - stored_cmdsets.sort(key=lambda x: x.priority, reverse=True) + # all() returns a 'stack', so make a copy to sort. + stored_cmdsets = sorted(obj.cmdset.all(), key=lambda x: x.priority, reverse=True) string += "\n{wStored Cmdset(s){n:\n %s" % ("\n ".join("%s [%s] (%s, prio %s)" % \ (cmdset.path, cmdset.key, cmdset.mergetype, cmdset.priority) for cmdset in stored_cmdsets if cmdset.key != "_EMPTY_CMDSET"))