From 3056786f38734ed0e197c42704074769b43785f3 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 705d38c9b5..c38eec7a85 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) + while((k = ar.GetKey())) { - 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; + 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