diff --git a/source/games/duke/src/savegame.cpp b/source/games/duke/src/savegame.cpp index bdc7c4e2a..49e0f582f 100644 --- a/source/games/duke/src/savegame.cpp +++ b/source/games/duke/src/savegame.cpp @@ -296,7 +296,11 @@ void DDukeActor::Serialize(FSerializer& arc) FSerializer& Serialize(FSerializer& arc, const char* keyname, Cycler& w, Cycler* def) { static Cycler nul; - if (!def) def = &nul; + if (!def) + { + def = &nul; + if (arc.isReading()) w = {}; + } if (arc.BeginObject(keyname)) { arc("sector", w.sector, def->sector) @@ -313,7 +317,11 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, Cycler& w, Cycler* FSerializer& Serialize(FSerializer& arc, const char* keyname, AmbientTags& w, AmbientTags* def) { static AmbientTags nul; - if (!def) def = &nul; + if (!def) + { + def = &nul; + if (arc.isReading()) w = {}; + } if (arc.BeginObject(keyname)) { arc("lotag", w.lo, def->lo) @@ -326,7 +334,11 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, AmbientTags& w, Am FSerializer& Serialize(FSerializer& arc, const char* keyname, animate& w, animate* def) { static animate nul; - if (!def) def = &nul; + if (!def) + { + def = &nul; + if (arc.isReading()) w = {}; + } if (arc.BeginObject(keyname)) { arc("sector", w.sect, def->sect)