Skip to content

Commit 7ba1db3

Browse files
fix progression transfer error when IOI profile has no PlayerProfileXP
1 parent 66595a8 commit 7ba1db3

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

components/webFeatures.ts

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -439,26 +439,29 @@ webFeaturesRouter.post(
439439
"progressionTransfer",
440440
)
441441

442-
const sublocations = exts.data.Extensions.progression
443-
.PlayerProfileXP
444-
.Sublocations as unknown as OfficialSublocation[]
445-
446-
userdata.Extensions.progression.PlayerProfileXP = {
447-
...userdata.Extensions.progression.PlayerProfileXP,
448-
Total: exts.data.Extensions.progression.PlayerProfileXP
449-
.Total,
450-
ProfileLevel: levelForXp(
451-
exts.data.Extensions.progression.PlayerProfileXP.Total,
452-
),
453-
Sublocations: Object.fromEntries(
454-
sublocations.map((value) => [
455-
value.Location,
456-
{
457-
Xp: value.Xp,
458-
ActionXp: value.ActionXp,
459-
},
460-
]),
461-
),
442+
if (exts.data.Extensions.progression.PlayerProfileXP) {
443+
const sublocations = exts.data.Extensions.progression
444+
.PlayerProfileXP
445+
.Sublocations as unknown as OfficialSublocation[]
446+
447+
userdata.Extensions.progression.PlayerProfileXP = {
448+
...userdata.Extensions.progression.PlayerProfileXP,
449+
Total: exts.data.Extensions.progression.PlayerProfileXP
450+
.Total,
451+
ProfileLevel: levelForXp(
452+
exts.data.Extensions.progression.PlayerProfileXP
453+
.Total,
454+
),
455+
Sublocations: Object.fromEntries(
456+
sublocations.map((value) => [
457+
value.Location,
458+
{
459+
Xp: value.Xp,
460+
ActionXp: value.ActionXp,
461+
},
462+
]),
463+
),
464+
}
462465
}
463466

464467
log(

0 commit comments

Comments
 (0)