From 65af7a56993e19c29681ca1ea9e9799ed4385373 Mon Sep 17 00:00:00 2001 From: Mumble Date: Sun, 18 Aug 2024 13:51:08 -0700 Subject: [PATCH] [Bug] Preventing the MBH from being stolen in Endless (#3630) * Endless MBH Fix * add import * Revert "add import" This reverts commit 814a4059c2830e972c348d698259535e117850bf. * Revert "Endless MBH Fix" This reverts commit 8eb448130132ff9eed614a2ec576926814008df0. * removed newline --------- Co-authored-by: Frederico Santos Co-authored-by: frutescens --- src/battle-scene.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 674b4e256f9..ae6cea2dcd1 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -2419,9 +2419,14 @@ export default class BattleScene extends SceneBase { count = Math.max(count, Math.floor(chances / 2)); } getEnemyModifierTypesForWave(difficultyWaveIndex, count, [ enemyPokemon ], this.currentBattle.battleType === BattleType.TRAINER ? ModifierPoolType.TRAINER : ModifierPoolType.WILD, upgradeChance) - .map(mt => mt.newModifier(enemyPokemon).add(this.enemyModifiers, false, this)); + .map(mt => { + const enemyModifier = mt.newModifier(enemyPokemon); + if (enemyModifier instanceof TurnHeldItemTransferModifier) { + enemyModifier.setTransferrableFalse(); + } + enemyModifier.add(this.enemyModifiers, false, this); + }); }); - this.updateModifiers(false).then(() => resolve()); }); }