[BUG] Children of DefaultScript sometimes revert to their parent until a server reload
See original GitHub issueDescribe the bug
When creating extensions of DefaultScript to apply object-oriented programming to things that don’t have a physical presence in the world (e.g. stored settings for a user), these custom scripts sometimes revert back to DefaultScript and begin throwing errors until the server is reloaded.
To Reproduce
No consistent reproduction that I have found, but occasionally this error will occur when the server has been running for a while:
AttributeError: 'DefaultScript' object has no attribute 'wear_outfit'
An untrapped error occurred. Please file a bug report detailing the steps to reproduce.
The scripts are supposed to be SavedOutfit objects, not DefaultScript. Reloading the server restores their proper type and eliminates the error temporarily.
Expected behavior
A class descending from DefaultScript retains any additional functions, properties, etc. and does not revert into a generic DefaultScript object.
Environment, Evennia version, OS etc
Evennia version: 0.9.5 (rev da1885aaa) OS: posix Python: 3.8.10 Twisted: 21.7.0 Django: 3.2.8
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Looks like it may have been due to an ImportError from a circular import? Going to fix that and wait to see if it happens again.
Closing this unless noted otherwise.