From 1565ac3a72173d681c819f4b84480a613d0fe974 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 26 Jun 2011 15:36:49 +0000 Subject: [PATCH] Fixed a rare conditional bug affecting Exits with custom cmdsets on them. --- src/commands/cmdsethandler.py | 19 ++++++++++++++----- src/commands/default/building.py | 2 ++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/commands/cmdsethandler.py b/src/commands/cmdsethandler.py index 2b45773b1f..9240be2018 100644 --- a/src/commands/cmdsethandler.py +++ b/src/commands/cmdsethandler.py @@ -171,11 +171,14 @@ class CmdSetHandler(object): for snum, cmdset in enumerate(self.cmdset_stack): num = snum mergetype = self.mergetype_stack[snum] + permstring = "non-perm" + if cmdset.permanent: + permstring = "perm" if mergetype != cmdset.mergetype: mergetype = "%s^" % (mergetype) - string += "\n %i: <%s (%s, prio %i)>: %s" % \ + string += "\n %i: <%s (%s, prio %i, %s)>: %s" % \ (snum, cmdset.key, mergetype, - cmdset.priority, cmdset) + cmdset.priority, permstring, cmdset) mergelist.append(str(snum)) string += "\n" @@ -183,11 +186,14 @@ class CmdSetHandler(object): mergetype = self.mergetype_stack[-1] if mergetype != self.current.mergetype: merged_on = self.cmdset_stack[-2].key - mergetype = "custom %s on %s" % (mergetype, merged_on) + mergetype = "custom %s on cmdset '%s'" % (mergetype, merged_on) if mergelist: string += " : %s" % ("+".join(mergelist), mergetype, self.current.priority, self.current) else: - string += " <%s (%s, prio %i)>: %s" % (self.current.key, mergetype, self.current.priority, + permstring = "non-perm" + if self.current.permanent: + permstring = "perm" + string += " <%s (%s, prio %i, %s)>: %s" % (self.current.key, mergetype, self.current.priority, permstring, ", ".join(cmd.key for cmd in sorted(self.current, key=lambda o:o.key))) return string.strip() @@ -270,7 +276,10 @@ class CmdSetHandler(object): # store the path permanently cmdset.permanent = True storage = self.obj.cmdset_storage - storage.append(cmdset.path) + if not storage: + storage = ["", cmdset.path] + else: + storage.append(cmdset.path) self.obj.cmdset_storage = storage else: cmdset.permanent = False diff --git a/src/commands/default/building.py b/src/commands/default/building.py index c668210425..2df2bc461a 100644 --- a/src/commands/default/building.py +++ b/src/commands/default/building.py @@ -559,6 +559,8 @@ class CmdDestroy(MuxCommand): if dmin and dmax: for dbref in range(int(dmin),int(dmax+1)): string += delobj(str(dbref)) + else: + string += delobj(objname) else: string += delobj(objname) if string: