Sanitize overrides before tests

Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
This commit is contained in:
Sirz Benjie 2025-03-27 12:08:41 -05:00
parent 1d96f00d96
commit 93f261257e
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E
2 changed files with 5 additions and 2 deletions

View File

@ -1403,7 +1403,10 @@ export default class BattleScene extends SceneBase {
this.field.add(newTrainer); this.field.add(newTrainer);
} }
} else { } else {
if (!this.gameMode.hasTrainers) { if (
!this.gameMode.hasTrainers ||
(Overrides.DISABLE_STANDARD_TRAINERS_OVERRIDE && isNullOrUndefined(trainerData))
) {
newBattleType = BattleType.WILD; newBattleType = BattleType.WILD;
} else if (battleType === undefined) { } else if (battleType === undefined) {
newBattleType = this.gameMode.isWaveTrainer(newWaveIndex, this.arena) ? BattleType.TRAINER : BattleType.WILD; newBattleType = this.gameMode.isWaveTrainer(newWaveIndex, this.arena) ? BattleType.TRAINER : BattleType.WILD;

View File

@ -227,7 +227,7 @@ export class OverridesHelper extends GameManagerHelper {
* @returns `this` * @returns `this`
*/ */
public disableTrainerWaves(): this { public disableTrainerWaves(): this {
vi.spyOn(Overrides, "DISABLE_STANDARD_TRAINERS_OVERRIDE"); vi.spyOn(Overrides, "DISABLE_STANDARD_TRAINERS_OVERRIDE", "get").mockReturnValue(true);
this.log("Standard trainer waves are disabled!"); this.log("Standard trainer waves are disabled!");
return this; return this;
} }