mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 14:59:26 +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 { CustomModifierSettings } from "#app/modifier/modifier-type";
|
||||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { isNullOrUndefined } from "./utils";
|
|
||||||
|
|
||||||
export enum ClassicFixedBossWaves {
|
export enum ClassicFixedBossWaves {
|
||||||
// TODO: other fixed wave battles should be added here
|
// 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}
|
* Returns if the battle is of type {@linkcode BattleType.MYSTERY_ENCOUNTER}
|
||||||
*/
|
*/
|
||||||
isBattleMysteryEncounter(): boolean {
|
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);
|
this.scene.updateModifiers(true);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
const { battleType, waveIndex, isBattleMysteryEncounter } = this.scene.currentBattle;
|
const { battleType, waveIndex } = this.scene.currentBattle;
|
||||||
if (this.scene.isMysteryEncounterValidForWave(battleType, waveIndex) && !isBattleMysteryEncounter()) {
|
if (this.scene.isMysteryEncounterValidForWave(battleType, waveIndex) && !this.scene.currentBattle.isBattleMysteryEncounter()) {
|
||||||
// Increment ME spawn chance if an ME could have spawned but did not
|
// 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
|
// Only do this AFTER session has been saved to avoid duplicating increments
|
||||||
this.scene.mysteryEncounterSaveData.encounterSpawnChance += WEIGHT_INCREMENT_ON_SPAWN_MISS;
|
this.scene.mysteryEncounterSaveData.encounterSpawnChance += WEIGHT_INCREMENT_ON_SPAWN_MISS;
|
||||||
|
Loading…
Reference in New Issue
Block a user