diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index e78bf3d8..4aa44387 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -78,19 +78,18 @@ const inventoryController: RequestHandler = async (request: Request, response: R } } - if ( - typeof config.spoofMasteryRank === "number" && - config.spoofMasteryRank >= 0 && - config.spoofMasteryRank <= 5030 - ) { + if (typeof config.spoofMasteryRank === "number" && config.spoofMasteryRank >= 0) { inventoryResponse.PlayerLevel = config.spoofMasteryRank; - inventoryResponse.XPInfo = []; - let numFrames = getExpRequiredForMr(config.spoofMasteryRank) / 6000; - while (numFrames-- > 0) { - inventoryResponse.XPInfo.push({ - ItemType: "/Lotus/Powersuits/Mag/Mag", - XP: 1_600_000 - }); + if (!("xpBasedLevelCapDisabled" in request.query)) { + // This client has not been patched to accept any mastery rank, need to fake the XP. + inventoryResponse.XPInfo = []; + let numFrames = getExpRequiredForMr(Math.min(config.spoofMasteryRank, 5030)) / 6000; + while (numFrames-- > 0) { + inventoryResponse.XPInfo.push({ + ItemType: "/Lotus/Powersuits/Mag/Mag", + XP: 1_600_000 + }); + } } } diff --git a/static/webui/script.js b/static/webui/script.js index 15db05d7..0475a730 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -123,7 +123,7 @@ window.itemListPromise = new Promise(resolve => { }); function updateInventory() { - const req = $.get("/api/inventory.php?" + window.authz); + const req = $.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1"); req.done(data => { window.itemListPromise.then(itemMap => { document.getElementById("warframe-list").innerHTML = ""; @@ -539,7 +539,7 @@ function doAcquireRiven() { }) }).done(function () { // Get riven's assigned id - $.get("/api/inventory.php?" + window.authz).done(data => { + $.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1").done(data => { for (const rawUpgrade of data.RawUpgrades) { if (rawUpgrade.ItemType === uniqueName) { // Add fingerprint to riven