From ff6f9131ae50da6002a7114a721bea1d727a8dde Mon Sep 17 00:00:00 2001 From: Jimmybald1 <122436263+Jimmybald1@users.noreply.github.com> Date: Fri, 30 May 2025 05:39:55 +0200 Subject: [PATCH] [Dev] Fixed biome override not working for Daily Mode (#5776) --- src/game-mode.ts | 10 +++++++--- src/overrides.ts | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/game-mode.ts b/src/game-mode.ts index ec7171b0024..97398d2b0a9 100644 --- a/src/game-mode.ts +++ b/src/game-mode.ts @@ -7,7 +7,7 @@ import type PokemonSpecies from "./data/pokemon-species"; import { allSpecies } from "./data/pokemon-species"; import type { Arena } from "./field/arena"; import Overrides from "#app/overrides"; -import { randSeedInt, randSeedItem } from "#app/utils/common"; +import { isNullOrUndefined, randSeedInt, randSeedItem } from "#app/utils/common"; import { Biome } from "#enums/biome"; import { Species } from "#enums/species"; import { Challenges } from "./enums/challenges"; @@ -124,16 +124,20 @@ export class GameMode implements GameModeConfig { /** * @returns either: - * - random biome for Daily mode * - override from overrides.ts + * - random biome for Daily mode * - Town */ getStartingBiome(): Biome { + if (!isNullOrUndefined(Overrides.STARTING_BIOME_OVERRIDE)) { + return Overrides.STARTING_BIOME_OVERRIDE; + } + switch (this.modeId) { case GameModes.DAILY: return getDailyStartingBiome(); default: - return Overrides.STARTING_BIOME_OVERRIDE || Biome.TOWN; + return Biome.TOWN; } } diff --git a/src/overrides.ts b/src/overrides.ts index 5bbd29b355f..95c758d7c43 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -73,7 +73,7 @@ class DefaultOverrides { */ readonly BATTLE_STYLE_OVERRIDE: BattleStyle | null = null; readonly STARTING_WAVE_OVERRIDE: number = 0; - readonly STARTING_BIOME_OVERRIDE: Biome = Biome.TOWN; + readonly STARTING_BIOME_OVERRIDE: Biome | null = null; readonly ARENA_TINT_OVERRIDE: TimeOfDay | null = null; /** Multiplies XP gained by this value including 0. Set to null to ignore the override. */ readonly XP_MULTIPLIER_OVERRIDE: number | null = null;