Update init_evennia_properties() to also init properties of parent classes
This commit is contained in:
parent
5b2963fc46
commit
a38b179e51
1 changed files with 15 additions and 6 deletions
|
|
@ -347,12 +347,21 @@ class TypedObject(SharedMemoryModel):
|
||||||
Called by creation methods; makes sure to initialize Attribute/TagProperties
|
Called by creation methods; makes sure to initialize Attribute/TagProperties
|
||||||
by fetching them once.
|
by fetching them once.
|
||||||
"""
|
"""
|
||||||
for propkey, prop in self.__class__.__dict__.items():
|
evennia_properties = set()
|
||||||
if isinstance(prop, (AttributeProperty, TagProperty, TagCategoryProperty)):
|
for base in type(self).__mro__:
|
||||||
try:
|
evennia_properties.update(
|
||||||
getattr(self, propkey)
|
{
|
||||||
except Exception:
|
propkey
|
||||||
log_trace()
|
for propkey, prop in vars(base).items()
|
||||||
|
if isinstance(prop, (AttributeProperty, TagProperty, TagCategoryProperty))
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
for propkey in evennia_properties:
|
||||||
|
try:
|
||||||
|
getattr(self, propkey)
|
||||||
|
except Exception:
|
||||||
|
log_trace()
|
||||||
|
|
||||||
# initialize all handlers in a lazy fashion
|
# initialize all handlers in a lazy fashion
|
||||||
@lazy_property
|
@lazy_property
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue