feat: mods in pre-U18.18 builds + equipment features in pre-U24.4 builds #3040

Merged
Sainan merged 10 commits from VoltPrime/SpaceNinjaServer:mods-equipmentfeatures-legacy into main 2025-11-18 00:27:12 -08:00
2 changed files with 6 additions and 3 deletions
Showing only changes of commit 1ca5ca27c6 - Show all commits

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;