From b7f05e851c39d28ab6388d3b37a3ed3fda41cba3 Mon Sep 17 00:00:00 2001 From: Sainan Date: Sun, 16 Mar 2025 04:33:12 -0700 Subject: [PATCH] fix: handle high spoofed mastery rank plus noDailyStandingLimits (#1201) In case the spoofed mastery rank is so high that 999,999 is *less* than the assumed maximum value for daily affiliation bins, we'll just use that so that the bar is always (at least) 100% full. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1201 --- src/controllers/api/inventoryController.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index 77f7bb1c..040557c3 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -246,8 +246,9 @@ export const getInventoryResponse = async ( } if (config.noDailyStandingLimits) { + const spoofedDailyAffiliation = Math.max(999_999, 16000 + inventoryResponse.PlayerLevel * 500); for (const key of allDailyAffiliationKeys) { - inventoryResponse[key] = 999_999; + inventoryResponse[key] = spoofedDailyAffiliation; } }