Fix mod configs not saving in U10-U11
All checks were successful
Build / build (pull_request) Successful in 1m13s

This commit is contained in:
2025-11-17 06:56:33 -05:00
parent 470c3b38c0
commit 1ca5ca27c6
2 changed files with 6 additions and 3 deletions

View File

@@ -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;

View File

@@ -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;