Profile: setResource() now can create an array if it's missing.

This commit is contained in:
Guillaume Jacquemin 2022-11-21 18:59:30 +01:00
parent fb6246cff7
commit bf820f65ec
1 changed files with 3 additions and 3 deletions

View File

@ -412,9 +412,9 @@ auto Profile::setResource(Containers::StringView container, MaterialID id, Int a
auto mats_prop = _profile.at<ArrayProperty>(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){