Fix mod configs not saving in U10-U11
All checks were successful
Build / build (pull_request) Successful in 1m13s
All checks were successful
Build / build (pull_request) Successful in 1m13s
This commit is contained in:
@@ -492,7 +492,7 @@ export const getInventoryResponse = async (
|
||||
for (let i = 0; i < rawUpgrade.ItemCount; i++) {
|
||||
const card = {
|
||||
ItemType: rawUpgrade.ItemType,
|
||||
ItemId: toOid2(new Types.ObjectId(), buildLabel),
|
||||
ItemId: toOid2(id, buildLabel),
|
||||
Rank: 0,
|
||||
AmountRemaining: rawUpgrade.ItemCount
|
||||
} as IUpgradeClient;
|
||||
|
||||
@@ -205,9 +205,10 @@ export const handleInventoryItemConfigChange = async (
|
||||
const convertedUpgrades: string[] = [];
|
||||
c.Upgrades.forEach(upgrade => {
|
||||
const upgradeId = upgrade as { $id: string };
|
||||
convertedUpgrades.push(upgradeId.$id);
|
||||
const rawUpgrade = inventory.RawUpgrades.id(upgradeId.$id);
|
||||
if (rawUpgrade) {
|
||||
const newId = new Types.ObjectId();
|
||||
convertedUpgrades.push(newId.toString());
|
||||
addMods(inventory, [
|
||||
{
|
||||
ItemType: rawUpgrade.ItemType,
|
||||
@@ -217,8 +218,10 @@ export const handleInventoryItemConfigChange = async (
|
||||
inventory.Upgrades.push({
|
||||
UpgradeFingerprint: `{"lvl":0}`,
|
||||
ItemType: rawUpgrade.ItemType,
|
||||
_id: upgradeId.$id
|
||||
_id: newId
|
||||
});
|
||||
} else {
|
||||
convertedUpgrades.push(upgradeId.$id);
|
||||
}
|
||||
});
|
||||
c.Upgrades = convertedUpgrades;
|
||||
|
||||
Reference in New Issue
Block a user