upgrade regions format version to 3

This commit is contained in:
MihailRis
2024-09-06 12:25:52 +03:00
parent 69b90f53c3
commit e30c1b3c03
15 changed files with 138 additions and 149 deletions
+13 -1
View File
@@ -55,7 +55,9 @@ std::shared_ptr<ContentReport> ContentReport::create(
report->items.setup(itemlist.get(), content->items);
report->buildIssues();
if (report->hasContentReorder() || report->hasMissingContent()) {
if (report->isUpgradeRequired() ||
report->hasContentReorder() ||
report->hasMissingContent()) {
return report;
} else {
return nullptr;
@@ -79,6 +81,16 @@ static void build_issues(
void ContentReport::buildIssues() {
build_issues(issues, blocks);
build_issues(issues, items);
if (regionsVersion < REGION_FORMAT_VERSION) {
for (int layer = REGION_LAYER_VOXELS;
layer < REGION_LAYERS_COUNT;
layer++) {
ContentIssue issue {ContentIssueType::REGION_FORMAT_UPDATE};
issue.regionLayer = static_cast<RegionLayerIndex>(layer);
issues.push_back(issue);
}
}
}
const std::vector<ContentIssue>& ContentReport::getIssues() const {