feat: mods in pre-U18.18 builds + equipment features in pre-U24.4 builds #3040
@@ -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