mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 06:49:35 +02:00
fix null exception on isBattleMysteryEncounter
This commit is contained in:
parent
ecf9103350
commit
d1c4a2e74c
@ -19,7 +19,6 @@ import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
||||
import { CustomModifierSettings } from "#app/modifier/modifier-type";
|
||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
import { isNullOrUndefined } from "./utils";
|
||||
|
||||
export enum ClassicFixedBossWaves {
|
||||
// TODO: other fixed wave battles should be added here
|
||||
@ -415,7 +414,7 @@ export default class Battle {
|
||||
* Returns if the battle is of type {@linkcode BattleType.MYSTERY_ENCOUNTER}
|
||||
*/
|
||||
isBattleMysteryEncounter(): boolean {
|
||||
return !isNullOrUndefined(this.battleType) && this.battleType === BattleType.MYSTERY_ENCOUNTER;
|
||||
return this.battleType === BattleType.MYSTERY_ENCOUNTER;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -253,8 +253,8 @@ export class EncounterPhase extends BattlePhase {
|
||||
this.scene.updateModifiers(true);
|
||||
}*/
|
||||
|
||||
const { battleType, waveIndex, isBattleMysteryEncounter } = this.scene.currentBattle;
|
||||
if (this.scene.isMysteryEncounterValidForWave(battleType, waveIndex) && !isBattleMysteryEncounter()) {
|
||||
const { battleType, waveIndex } = this.scene.currentBattle;
|
||||
if (this.scene.isMysteryEncounterValidForWave(battleType, waveIndex) && !this.scene.currentBattle.isBattleMysteryEncounter()) {
|
||||
// Increment ME spawn chance if an ME could have spawned but did not
|
||||
// Only do this AFTER session has been saved to avoid duplicating increments
|
||||
this.scene.mysteryEncounterSaveData.encounterSpawnChance += WEIGHT_INCREMENT_ON_SPAWN_MISS;
|
||||
|
Loading…
Reference in New Issue
Block a user