Fix profile creation error

This commit is contained in:
Dev 2023-10-21 20:13:29 +01:00
parent 573d91a9c2
commit 018b0a8f70

View File

@ -102,16 +102,16 @@ export class PlayerScavGenerator
scavData.UnlockedInfo = pmcData.UnlockedInfo; scavData.UnlockedInfo = pmcData.UnlockedInfo;
// Persist previous scav data into new scav // Persist previous scav data into new scav
scavData._id = existingScavData._id; scavData._id = existingScavData._id ?? pmcData.savage;
scavData.sessionId = existingScavData.sessionId; scavData.sessionId = existingScavData.sessionId ?? pmcData.sessionId;
scavData.Skills = this.getScavSkills(existingScavData); scavData.Skills = this.getScavSkills(existingScavData);
scavData.Stats = this.getScavStats(existingScavData); scavData.Stats = this.getScavStats(existingScavData);
scavData.Info.Level = this.getScavLevel(existingScavData); scavData.Info.Level = this.getScavLevel(existingScavData);
scavData.Info.Experience = this.getScavExperience(existingScavData); scavData.Info.Experience = this.getScavExperience(existingScavData);
scavData.Quests = existingScavData.Quests; scavData.Quests = existingScavData.Quests ?? [];
scavData.ConditionCounters = existingScavData.ConditionCounters; scavData.ConditionCounters = existingScavData.ConditionCounters ?? {Counters: []};
scavData.Notes = existingScavData.Notes; scavData.Notes = existingScavData.Notes ?? {Notes: []};
scavData.WishList = existingScavData.WishList; scavData.WishList = existingScavData.WishList ?? [];
// Add an extra labs card to pscav backpack based on config chance // Add an extra labs card to pscav backpack based on config chance