From bf820f65ec47c999ffe96bbc5841e256ebab6406 Mon Sep 17 00:00:00 2001 From: William JCM Date: Mon, 21 Nov 2022 18:59:30 +0100 Subject: [PATCH] Profile: setResource() now can create an array if it's missing. --- src/Profile/Profile.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Profile/Profile.cpp b/src/Profile/Profile.cpp index c432188..ed0d9d4 100644 --- a/src/Profile/Profile.cpp +++ b/src/Profile/Profile.cpp @@ -412,9 +412,9 @@ auto Profile::setResource(Containers::StringView container, MaterialID id, Int a auto mats_prop = _profile.at(container); if(!mats_prop) { - _lastError = "Couldn't find "_s + container + " in "_s + _filename; - _valid = false; - return false; + mats_prop = new ArrayProperty; + mats_prop->name.emplace(container); + _profile.appendProperty(ArrayProperty::ptr{mats_prop}); } auto predicate = [&id](UnrealPropertyBase::ptr& prop){