avoid duplicate entries in inventory.EvolutionProgress
This commit is contained in:
parent
3c27f01ad2
commit
dcdf03c9ce
@ -21,11 +21,13 @@ export const evolveWeaponController: RequestHandler = async (req, res) => {
|
||||
item.SkillTree = "0";
|
||||
|
||||
inventory.EvolutionProgress ??= [];
|
||||
if (!inventory.EvolutionProgress.find(entry => entry.ItemType == payload.EvoType)) {
|
||||
inventory.EvolutionProgress.push({
|
||||
Progress: 0,
|
||||
Rank: 1,
|
||||
ItemType: payload.EvoType
|
||||
});
|
||||
}
|
||||
|
||||
await inventory.save();
|
||||
res.end();
|
||||
|
Loading…
x
Reference in New Issue
Block a user