From 9d99625cb2d3d408f30a54ef169a894002723aa4 Mon Sep 17 00:00:00 2001 From: Dys <50160441+Dystopia-user181@users.noreply.github.com> Date: Sun, 24 Apr 2022 16:29:23 +0800 Subject: [PATCH 1/2] Fix bug where bulk dimboosts could buy more than the capped amount --- javascripts/core/dimboost.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javascripts/core/dimboost.js b/javascripts/core/dimboost.js index a3057c1e6..5c0ad4e04 100644 --- a/javascripts/core/dimboost.js +++ b/javascripts/core/dimboost.js @@ -168,7 +168,7 @@ export class DimBoost { export function softReset(bulk, forcedNDReset = false, forcedAMReset = false) { if (Currency.antimatter.gt(Player.infinityLimit)) return; EventHub.dispatch(GAME_EVENT.DIMBOOST_BEFORE, bulk); - player.dimensionBoosts = Math.max(0, player.dimensionBoosts + bulk); + player.dimensionBoosts = Math.min(Math.max(0, player.dimensionBoosts + bulk), DimBoost.maxBoosts); resetChallengeStuff(); if ( forcedNDReset || @@ -202,7 +202,7 @@ export function skipResetsIfPossible() { export function requestDimensionBoost(bulk) { if (Currency.antimatter.gt(Player.infinityLimit) || !DimBoost.requirement.isSatisfied) return; if (!DimBoost.canBeBought) return; - if (BreakInfinityUpgrade.autobuyMaxDimboosts.isBought && bulk) maxBuyDimBoosts(true); + if (BreakInfinityUpgrade.autobuyMaxDimboosts.isBought && bulk) maxBuyDimBoosts(); else softReset(1); } From 6438ba5fb81345b769c16d8a8be533cdbf10754c Mon Sep 17 00:00:00 2001 From: Dys <50160441+Dystopia-user181@users.noreply.github.com> Date: Mon, 25 Apr 2022 08:31:49 +0800 Subject: [PATCH 2/2] Fix unintended behaviour where dispatched dimboost_x events may have wrong bulk --- javascripts/core/dimboost.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/javascripts/core/dimboost.js b/javascripts/core/dimboost.js index 5c0ad4e04..2b39897f9 100644 --- a/javascripts/core/dimboost.js +++ b/javascripts/core/dimboost.js @@ -165,10 +165,11 @@ export class DimBoost { } } -export function softReset(bulk, forcedNDReset = false, forcedAMReset = false) { +export function softReset(tempBulk, forcedNDReset = false, forcedAMReset = false) { if (Currency.antimatter.gt(Player.infinityLimit)) return; + const bulk = Math.min(tempBulk, DimBoost.maxBoosts - player.dimensionBoosts); EventHub.dispatch(GAME_EVENT.DIMBOOST_BEFORE, bulk); - player.dimensionBoosts = Math.min(Math.max(0, player.dimensionBoosts + bulk), DimBoost.maxBoosts); + player.dimensionBoosts = Math.max(0, player.dimensionBoosts + bulk); resetChallengeStuff(); if ( forcedNDReset ||