Fix trainer-related crash when loading data
This commit is contained in:
parent
4fc92f22d9
commit
b201cf0abc
|
@ -576,8 +576,8 @@ export class GameData {
|
|||
scene.updateScoreText();
|
||||
|
||||
const battleType = sessionData.battleType || 0;
|
||||
const trainerConfig = trainerConfigs[sessionData.trainer.trainerType];
|
||||
const battle = scene.newBattle(sessionData.waveIndex, battleType, sessionData.trainer, battleType === BattleType.TRAINER ? trainerConfig.doubleOnly || sessionData.trainer.variant === TrainerVariant.DOUBLE : sessionData.enemyParty.length > 1);
|
||||
const trainerConfig = sessionData.trainer ? trainerConfigs[sessionData.trainer.trainerType] : null;
|
||||
const battle = scene.newBattle(sessionData.waveIndex, battleType, sessionData.trainer, battleType === BattleType.TRAINER ? trainerConfig?.doubleOnly || sessionData.trainer?.variant === TrainerVariant.DOUBLE : sessionData.enemyParty.length > 1);
|
||||
battle.enemyLevels = sessionData.enemyParty.map(p => p.level);
|
||||
|
||||
scene.newArena(sessionData.arena.biome, true);
|
||||
|
|
Loading…
Reference in New Issue