diff --git a/apps/objects/models.py b/apps/objects/models.py index 573df86539..4ddb6a9d93 100755 --- a/apps/objects/models.py +++ b/apps/objects/models.py @@ -324,7 +324,7 @@ class Object(models.Model): """ if self.has_attribute(attribute): # Attribute already exists, update it. - attrib_obj = Attribute.objects.filter(object=self).filter(name=attribute) + attrib_obj = Attribute.objects.filter(object=self).filter(name=attribute)[0] attrib_obj.value = new_value attrib_obj.save() else: @@ -445,14 +445,14 @@ class Object(models.Model): def get_attribute_value(self, attrib, default=False): """ - Returns the value of an attribute on an object. + Returns the value of an attribute on an object. You may need to + type cast the returned value from this function! attrib: (str) The attribute's name. """ if self.has_attribute(attrib): attrib = Attribute.objects.filter(object=self).filter(name=attrib) - attrib_value = attrib[0].value - return attrib_value.value + return attrib[0].value else: if default: return default diff --git a/commands_general.py b/commands_general.py index 238dbcffdc..43a529239b 100644 --- a/commands_general.py +++ b/commands_general.py @@ -29,12 +29,12 @@ def cmd_inventory(cdat): for item in pobject.get_contents(): session.msg(" %s" % (item.get_ansiname(),)) - money = pobject.get_attribute_value("MONEY", default=0) - if money > 0: - money_name = functions_db.get_server_config("MONEY_NAME_PLURAL") - else: + money = int(pobject.get_attribute_value("MONEY", default=0)) + if money == 1: money_name = functions_db.get_server_config("MONEY_NAME_SINGULAR") - + else: + money_name = functions_db.get_server_config("MONEY_NAME_PLURAL") + session.msg("You have %d %s." % (money,money_name)) def cmd_look(cdat): diff --git a/commands_privileged.py b/commands_privileged.py index 27d3cd19c8..3a9338aa60 100644 --- a/commands_privileged.py +++ b/commands_privileged.py @@ -557,7 +557,7 @@ def cmd_set(cdat): attrib_value = eq_args[1][splicenum:] # In global_defines.py, see NOSET_ATTRIBS for protected attribute names. - if not functions_db.is_modifiable_attrib(attrib_name): + if not functions_db.is_modifiable_attrib(attrib_name) and not pobject.is_superuser(): session.msg("You can't modify that attribute.") return diff --git a/evennia.sql b/evennia.sql index 996055e5b4..600480cbbf 100755 Binary files a/evennia.sql and b/evennia.sql differ