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";
|
item.SkillTree = "0";
|
||||||
|
|
||||||
inventory.EvolutionProgress ??= [];
|
inventory.EvolutionProgress ??= [];
|
||||||
inventory.EvolutionProgress.push({
|
if (!inventory.EvolutionProgress.find(entry => entry.ItemType == payload.EvoType)) {
|
||||||
Progress: 0,
|
inventory.EvolutionProgress.push({
|
||||||
Rank: 1,
|
Progress: 0,
|
||||||
ItemType: payload.EvoType
|
Rank: 1,
|
||||||
});
|
ItemType: payload.EvoType
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user