From 1ecf53c96b2f5e619961d1e64ff0903def9fb914 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sun, 5 Oct 2025 05:56:58 -0700 Subject: [PATCH] chore: don't add 'alwaysAvailable' skins with unlockAllSkins (#2843) Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2843 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- src/controllers/api/inventoryController.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index f4a9cfb1..76484e6f 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -335,15 +335,16 @@ export const getInventoryResponse = async ( } if (config.unlockAllSkins) { - 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") - }, - ItemType: uniqueName - }); + const ownedWeaponSkins = new Set(inventoryResponse.WeaponSkins.map(x => x.ItemType)); + for (const [uniqueName, meta] of Object.entries(ExportCustoms)) { + if (!meta.alwaysAvailable && !ownedWeaponSkins.has(uniqueName)) { + inventoryResponse.WeaponSkins.push({ + ItemId: { + $oid: "ca70ca70ca70ca70" + catBreadHash(uniqueName).toString(16).padStart(8, "0") + }, + ItemType: uniqueName + }); + } } }