Merge pull request #3753 from JohniFi/fix-init_evennia_properties-include-parent
Let init_evennia_properties() also init properties of parent classes
This commit is contained in:
commit
b7e239e138
1 changed files with 15 additions and 6 deletions
|
|
@ -347,8 +347,17 @@ 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__:
|
||||||
|
evennia_properties.update(
|
||||||
|
{
|
||||||
|
propkey
|
||||||
|
for propkey, prop in vars(base).items()
|
||||||
|
if isinstance(prop, (AttributeProperty, TagProperty, TagCategoryProperty))
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
for propkey in evennia_properties:
|
||||||
try:
|
try:
|
||||||
getattr(self, propkey)
|
getattr(self, propkey)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue