Fix authorIds being saved in the prop elements of a project (#3084)

This commit is contained in:
ClementPasteau
2021-09-23 15:01:35 +02:00
committed by GitHub
parent 477e88d4ce
commit d4a3722ec8

View File

@@ -529,7 +529,7 @@ void Project::UnserializeFrom(const SerializerElement& element) {
propElement.GetBoolAttribute("useExternalSourceFiles");
authorIds.clear();
auto& authorIdsElement = element.GetChild("authorIds");
auto& authorIdsElement = propElement.GetChild("authorIds");
authorIdsElement.ConsiderAsArray();
for (std::size_t i = 0; i < authorIdsElement.GetChildrenCount(); ++i) {
authorIds.push_back(authorIdsElement.GetChild(i).GetStringValue());
@@ -727,7 +727,7 @@ void Project::SerializeTo(SerializerElement& element) const {
loadingScreen.SerializeTo(propElement.AddChild("loadingScreen"));
propElement.SetAttribute("useExternalSourceFiles", useExternalSourceFiles);
auto& authorIdsElement = element.AddChild("authorIds");
auto& authorIdsElement = propElement.AddChild("authorIds");
authorIdsElement.ConsiderAsArray();
for (const auto& authorId : authorIds) {
authorIdsElement.AddChild("").SetStringValue(authorId);