From 133dc41637cdc63994bab6987d58bcc39a7a534c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= Date: Tue, 14 Nov 2023 16:00:09 -0300 Subject: [PATCH] Add missing loop --- src/common/scripting/core/types.cpp | 35 ++++++++++++++++------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/common/scripting/core/types.cpp b/src/common/scripting/core/types.cpp index 705d38c9b52..c38eec7a851 100644 --- a/src/common/scripting/core/types.cpp +++ b/src/common/scripting/core/types.cpp @@ -2605,23 +2605,26 @@ static bool PMapValueReader(FSerializer &ar, M *map, const PMap *m) const char * k; if(m->KeyType == TypeName) { - typename M::ValueType * val; - if constexpr(std::is_same_v) - { - val = &map->InsertNew(FName(k).GetIndex()); - } - else - { - #ifdef __GNUC__ - __builtin_unreachable(); - #elif defined(_MSC_VER) - __assume(0); - #endif - } - if (!m->ValueType->ReadValue(ar,nullptr,static_cast(val))) + while((k = ar.GetKey())) { - ar.EndObject(); - return false; + typename M::ValueType * val; + if constexpr(std::is_same_v) + { + val = &map->InsertNew(FName(k).GetIndex()); + } + else + { + #ifdef __GNUC__ + __builtin_unreachable(); + #elif defined(_MSC_VER) + __assume(0); + #endif + } + if (!m->ValueType->ReadValue(ar,nullptr,static_cast(val))) + { + ar.EndObject(); + return false; + } } } else