From c8402ae497f21434e507375c11556e9bf99d6684 Mon Sep 17 00:00:00 2001 From: Sainan Date: Mon, 20 Jan 2025 07:01:07 +0100 Subject: [PATCH] don't spoof owned weapon skins --- src/controllers/api/inventoryController.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index 0b495ed6..b4e0035d 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -147,8 +147,9 @@ export const inventoryController: RequestHandler = async (request, response) => } if (config.unlockAllSkins) { - inventoryResponse.WeaponSkins = []; - for (const uniqueName in ExportCustoms) { + const missingWeaponSkins = new Set(Object.keys(ExportCustoms)); + inventoryResponse.WeaponSkins.forEach(x => missingWeaponSkins.delete(x.ItemType)); + for (const uniqueName of missingWeaponSkins) { inventoryResponse.WeaponSkins.push({ ItemId: { $oid: "ca70ca70ca70ca70" + catBreadHash(uniqueName).toString(16).padStart(8, "0")