fix: convert placed/removed deco types to inventory type
All checks were successful
Build / build (pull_request) Successful in 48s
All checks were successful
Build / build (pull_request) Successful in 48s
This commit is contained in:
parent
e234af098d
commit
4b32676bae
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user