From a429047452efd0ccf88ff16693d3fd964658796b Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 20 Mar 2011 01:19:05 +0000 Subject: [PATCH] Fixed a bug in @set that would not display attributes if they were set to 0 or None. --- src/commands/default/building.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/commands/default/building.py b/src/commands/default/building.py index ca4ebf6693..8aa5f6f489 100644 --- a/src/commands/default/building.py +++ b/src/commands/default/building.py @@ -1079,24 +1079,24 @@ class CmdSetAttribute(ObjManipCommand): if self.rhs == None: # no = means we inspect the attribute(s) for attr in attrs: - value = obj.attr(attr) - if value: - string += "\n%s.db.%s = %s" % (obj.name, attr, value) + if obj.has_attribute(attr): + string += "\nAttribute %s/%s = %s" % (obj.name, attr, obj.get_attribute(attr)) else: string += "\n%s has no attribute '%s'." % (obj.name, attr) else: # deleting the attribute(s) for attr in attrs: - if obj.attr(attr): - obj.attr(attr, delete=True) - string += "\nAttribute %s.db.%s deleted." % (obj.name, attr) + if obj.has_attribute(attr): + val = obj.get_attribute(attr) + obj.del_attribute(attr) + string += "\nDeleted attribute '%s' (= %s) from %s." % (attr, val, obj.name) else: string += "\n%s has no attribute '%s'." % (obj.name, attr) else: # setting attribute(s) for attr in attrs: - obj.attr(attr, value) - string += "\nAttribute %s.%s created." % (obj.name, attr) + obj.set_attribute(attr, value) + string += "\nCreated attribute %s/%s = %s" % (obj.name, attr, value) # send feedback caller.msg(string.strip('\n'))