diff --git a/src/controllers/api/nemesisController.ts b/src/controllers/api/nemesisController.ts index 919b5642..d995b093 100644 --- a/src/controllers/api/nemesisController.ts +++ b/src/controllers/api/nemesisController.ts @@ -18,7 +18,7 @@ import { import { getJSONfromString } from "../../helpers/stringHelpers.ts"; import type { TInventoryDatabaseDocument } from "../../models/inventoryModels/inventoryModel.ts"; import { Loadout } from "../../models/inventoryModels/loadoutModel.ts"; -import { addMods, freeUpSlot, getInventory, getAccountCheats } from "../../services/inventoryService.ts"; +import { addMods, freeUpSlot, getInventory } from "../../services/inventoryService.ts"; import { getAccountForRequest } from "../../services/loginService.ts"; import { SRng } from "../../services/rngService.ts"; import type { IMongoDate, IOid } from "../../types/commonTypes.ts"; @@ -30,7 +30,8 @@ import type { IUpgradeClient, IWeaponSkinClient, TEquipmentKey, - TNemesisFaction + TNemesisFaction, + IAccountCheats } from "../../types/inventoryTypes/inventoryTypes.ts"; import { InventorySlot, LoadoutIndex } from "../../types/inventoryTypes/inventoryTypes.ts"; import { logger } from "../../utils/logger.ts"; @@ -39,7 +40,9 @@ import { Types } from "mongoose"; export const nemesisController: RequestHandler = async (req, res) => { const account = await getAccountForRequest(req); - const accountCheats = await getAccountCheats(account._id.toString()); + const cheatProperties = Object.keys({} as IAccountCheats) as Array; + const accountCheats = await getInventory(account._id.toString(), cheatProperties.join(" ")); + if ((req.query.mode as string) == "f") { const body = getJSONfromString(String(req.body)); const inventory = await getInventory(account._id.toString(), body.Category + " WeaponBin"); @@ -246,7 +249,7 @@ export const nemesisController: RequestHandler = async (req, res) => { const dataknifeUpgrades = inventory.DataKnives[0].Configs[dataknifeConfigIndex].Upgrades!; for (let i = 3; i != 6; ++i) { //logger.debug(`subtracting a charge from ${dataknifeUpgrades[i]}`); - if (accountCheats.nemesisAlwaysCorrect){ + if (accountCheats.nemesisAlwaysCorrect) { break; } const upgrade = parseUpgrade(inventory, dataknifeUpgrades[i]); diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index 742cf90b..c8e25c1b 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -26,8 +26,7 @@ import type { INemesisWeaponTargetFingerprint, INemesisPetTargetFingerprint, IDialogueDatabase, - IKubrowPetPrintClient, - IAccountCheats + IKubrowPetPrintClient } from "../types/inventoryTypes/inventoryTypes.ts"; import { InventorySlot, equipmentKeys } from "../types/inventoryTypes/inventoryTypes.ts"; import type { IGenericUpdate, IUpdateNodeIntrosResponse } from "../types/genericUpdate.ts"; @@ -267,13 +266,6 @@ export const getInventory = async ( return inventory; }; -export const getAccountCheats = async (accountOwnerId: string): Promise> => { - const cheatProperties = Object.keys({} as IAccountCheats) as Array; - const inventoryWithCheats = await getInventory(accountOwnerId, cheatProperties.join(" ")); - - return inventoryWithCheats; -}; - export const productCategoryToInventoryBin = (productCategory: string): InventorySlot | undefined => { switch (productCategory) { case "Suits": diff --git a/src/services/missionInventoryUpdateService.ts b/src/services/missionInventoryUpdateService.ts index ca71dc82..c7786a1e 100644 --- a/src/services/missionInventoryUpdateService.ts +++ b/src/services/missionInventoryUpdateService.ts @@ -35,7 +35,6 @@ import { addStanding, applyClientEquipmentUpdates, combineInventoryChanges, - getAccountCheats, getDialogue, giveNemesisPetRecipe, giveNemesisWeaponRecipe,