diff --git a/source/common/engine/serializer.cpp b/source/common/engine/serializer.cpp index 1b56bba2c..505bd044d 100644 --- a/source/common/engine/serializer.cpp +++ b/source/common/engine/serializer.cpp @@ -1051,8 +1051,8 @@ FSerializer &Serialize(FSerializer &arc, const char *key, double &value, double auto val = arc.r->FindKey(key); if (val != nullptr) { - assert(val->IsDouble()); - if (val->IsDouble()) + assert(val->IsNumber()); + if (val->IsNumber()) { value = val->GetDouble(); } diff --git a/source/games/sw/src/save.cpp b/source/games/sw/src/save.cpp index 1d6c65a41..b060c4fa0 100644 --- a/source/games/sw/src/save.cpp +++ b/source/games/sw/src/save.cpp @@ -301,7 +301,6 @@ void postSerializePanelSprites(FSerializer& arc) } arc.EndArray(); } - pspAsArray.Clear(); } //--------------------------------------------------------------------------- @@ -1222,6 +1221,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, TRACK& w, TRACK* d void GameInterface::SerializeGameState(FSerializer& arc) { + pspAsArray.Clear(); Saveable_Init(); if (arc.BeginObject("state"))