by MartinHowe » Mon Jan 18, 2021 2:16 am
Player701 wrote:In mixin class M426_Nibbles there is a field of type ThinkerIterator called foodFinder. That GZDoom attempts to serialize it is probably an engine bug. The saving process should abort. To mitigate the issue right now, the field should be marked transient.
Thanks very much for spotting this

Some time ago I purged all my code of iterators stored as class fields, dunno how I missed that one

The value of a 'fresh pair of eyes'
I would say correct; the engine should not have tried to serialise it. Also if a field declared as a class member is abstract, but not marked transient, maybe the engine could issue a warning if, referring to the linked thread, its scope isn't UI?
(I fixed the mod, made that iterator local to the function; just watched a cat snacking on a dead imp, saved, played a bit, reloaded and it was fine; no iterators in the save game file either)
[quote="Player701"]In mixin class [b]M426_Nibbles[/b] there is a field of type ThinkerIterator called [b]foodFinder[/b]. That GZDoom attempts to serialize it is probably an engine bug. The saving process should abort. To mitigate the issue right now, the field should be marked transient.[/quote]Thanks very much for spotting this :thumb: Some time ago I purged all my code of iterators stored as class fields, dunno how I missed that one :( The value of a 'fresh pair of eyes' :)
[quote="Player701"]This would probably [url=https://forum.zdoom.org/viewtopic.php?t=62523]cause the saving process itself to fail[/url], so it's not user error even if there were class fields of such types in the mod.[/quote]I would say correct; the engine should not have tried to serialise it. Also if a field declared as a class member is abstract, but not marked transient, maybe the engine could issue a warning if, referring to the linked thread, its scope isn't UI?
(I fixed the mod, made that iterator local to the function; just watched a cat snacking on a dead imp, saved, played a bit, reloaded and it was fine; no iterators in the save game file either)