From 614a9ab0486ca36860ac9540f7d1e58e3beff0bd Mon Sep 17 00:00:00 2001 From: Tegiminis Date: Sun, 10 Jul 2022 02:32:05 -0700 Subject: [PATCH] makes attributeproperty "object-aware" --- evennia/typeclasses/attributes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evennia/typeclasses/attributes.py b/evennia/typeclasses/attributes.py index 7c5a537c19..1165c59ebf 100644 --- a/evennia/typeclasses/attributes.py +++ b/evennia/typeclasses/attributes.py @@ -224,7 +224,7 @@ class AttributeProperty: category=self._category, strattr=self._strattr, raise_exception=self._autocreate, - )) + ), instance) except AttributeError: if self._autocreate: # attribute didn't exist and autocreate is set @@ -274,7 +274,7 @@ class AttributeProperty: """ return value - def at_get(self, value): + def at_get(self, value, obj): """ The value returned from the Attribute is passed through this method. It can be used to react to the retrieval or modify the result in some way.