Kaynağa Gözat

Seed nothing for a scene authored without a resource

materialize_authored_scene_seeds treated every type-43 slot without a
resource row as a missing resource and refused the whole object, so one
scene authored empty left its region unseeded. The pack now marks such a
slot (kSlotAuthoredSceneUnresourced); a marked slot is skipped in both the
count and the write pass, after the shape checks and before the resource
lookup, so an unmarked slot without a resource is still refused.
Fozkais 1 hafta önce
ebeveyn
işleme
c9a3a2b869

+ 6 - 1
Sunrise/src/state/activity_sdk/activity_sdk_seeds.cpp

@@ -407,6 +407,10 @@ AuthoredSceneSeedStatus materialize_authored_scene_seeds(const Catalog& catalog,
             || (slot.flags & format::kSlotSchemaJoinExact) == 0) {
             return AuthoredSceneSeedStatus::schemaMismatch;
         }
+        // A scene authored without a resource has nothing to seed; it is not a missing one.
+        if ((slot.flags & format::kSlotAuthoredSceneUnresourced) != 0) {
+            continue;
+        }
 
         const auto resources = slot_authored_scene_resources(catalog, slot);
         if (resources.empty()) {
@@ -432,7 +436,8 @@ AuthoredSceneSeedStatus materialize_authored_scene_seeds(const Catalog& catalog,
     std::size_t written = 0;
     for (const format::Slot& slot : slots) {
         if (slot.slotType != format::kAuthoredSceneSlotType
-            || slot.componentClass == format::kAbsentIndex) {
+            || slot.componentClass == format::kAbsentIndex
+            || (slot.flags & format::kSlotAuthoredSceneUnresourced) != 0) {
             continue;
         }
         const auto resources = slot_authored_scene_resources(catalog, slot);