mirror of
https://github.com/IvarK/AntimatterDimensionsSourceCode.git
synced 2024-11-10 06:02:13 +00:00
Fix unintended behaviour where dispatched dimboost_x events may have wrong bulk
This commit is contained in:
parent
9d99625cb2
commit
6438ba5fb8
@ -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 ||
|
||||
|
Loading…
Reference in New Issue
Block a user