fix: properly convert personal room decos to and from inventory types #2279

Merged
OrdisPrime merged 2 commits from deco-inv into main 2025-06-25 08:03:57 -07:00
Showing only changes of commit 4b32676bae - Show all commits

View File

@ -13,6 +13,7 @@ import { config } from "./configService";
import { Guild } from "../models/guildModel";
import { hasGuildPermission } from "./guildService";
import { GuildPermission } from "../types/guildTypes";
import { ExportResources } from "warframe-public-export-plus";
export const setShipCustomizations = async (
accountId: string,
@ -121,7 +122,8 @@ export const handleSetShipDecorations = async (
if (!config.unlockAllShipDecorations) {
const inventory = await getInventory(accountId);
addShipDecorations(inventory, [{ ItemType: placedDecoration.Type, ItemCount: 1 }]);
const itemType = Object.entries(ExportResources).find(arr => arr[1].deco == placedDecoration.Type)![0];
addShipDecorations(inventory, [{ ItemType: itemType, ItemCount: 1 }]);
await inventory.save();
}
@ -134,7 +136,8 @@ export const handleSetShipDecorations = async (
} else {
if (!config.unlockAllShipDecorations) {
const inventory = await getInventory(accountId);
addShipDecorations(inventory, [{ ItemType: placedDecoration.Type, ItemCount: -1 }]);
const itemType = Object.entries(ExportResources).find(arr => arr[1].deco == placedDecoration.Type)![0];
addShipDecorations(inventory, [{ ItemType: itemType, ItemCount: -1 }]);
await inventory.save();
}
}