diff --git a/evennia/typeclasses/attributes.py b/evennia/typeclasses/attributes.py index 9f3dc8a124..7420d00c16 100644 --- a/evennia/typeclasses/attributes.py +++ b/evennia/typeclasses/attributes.py @@ -1390,11 +1390,12 @@ class AttributeHandler: """ self.backend.clear_attributes(category, accessing_obj, default_access) - def all(self, accessing_obj=None, default_access=True): + def all(self, category=None, accessing_obj=None, default_access=True): """ Return all Attribute objects on this object, regardless of category. Args: + category (str, optional): A given category to limit results to. accessing_obj (object, optional): Check the `attrread` lock on each attribute before returning them. If not given, this check is skipped. @@ -1408,6 +1409,8 @@ class AttributeHandler: """ attrs = self.backend.get_all_attributes() + if category: + attrs = [attr for attr in attrs if attr.category == category] if accessing_obj: return [