Update migration logic and set default NPC targetability to true in tests
This commit is contained in:
@@ -5240,9 +5240,7 @@ function migrateLegacySceneNpcTargetability(
|
|||||||
): SceneDocument {
|
): SceneDocument {
|
||||||
const targetableNpcIds = new Set(
|
const targetableNpcIds = new Set(
|
||||||
Object.values(document.interactionLinks)
|
Object.values(document.interactionLinks)
|
||||||
.filter((link) =>
|
.filter(hasLegacyNpcTargetingInteractionLink)
|
||||||
hasLegacyNpcTargetingInteractionLink(link, document.sequences)
|
|
||||||
)
|
|
||||||
.map((link) => link.sourceEntityId)
|
.map((link) => link.sourceEntityId)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -5292,9 +5290,7 @@ function migrateLegacyProjectNpcTargetability(
|
|||||||
for (const [sceneId, scene] of Object.entries(document.scenes)) {
|
for (const [sceneId, scene] of Object.entries(document.scenes)) {
|
||||||
const targetableNpcIds = new Set(
|
const targetableNpcIds = new Set(
|
||||||
Object.values(scene.interactionLinks)
|
Object.values(scene.interactionLinks)
|
||||||
.filter((link) =>
|
.filter(hasLegacyNpcTargetingInteractionLink)
|
||||||
hasLegacyNpcTargetingInteractionLink(link, document.sequences)
|
|
||||||
)
|
|
||||||
.map((link) => link.sourceEntityId)
|
.map((link) => link.sourceEntityId)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ describe("entity registry defaults", () => {
|
|||||||
expect(createDefaultEntityInstance("npc")).toMatchObject({
|
expect(createDefaultEntityInstance("npc")).toMatchObject({
|
||||||
kind: "npc",
|
kind: "npc",
|
||||||
position: { x: 0, y: 0, z: 0 },
|
position: { x: 0, y: 0, z: 0 },
|
||||||
targetable: false,
|
targetable: true,
|
||||||
yawDegrees: DEFAULT_NPC_YAW_DEGREES,
|
yawDegrees: DEFAULT_NPC_YAW_DEGREES,
|
||||||
modelAssetId: null
|
modelAssetId: null
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user