[Bug] fix boss-segment reload persistence: (#2613)
add boss-segments to into pokemon-data & load it in EnemyPokemon constructor
This commit is contained in:
parent
29283d81a0
commit
74a7b1bb79
|
@ -3385,7 +3385,7 @@ export class EnemyPokemon extends Pokemon {
|
||||||
|
|
||||||
this.trainerSlot = trainerSlot;
|
this.trainerSlot = trainerSlot;
|
||||||
if (boss) {
|
if (boss) {
|
||||||
this.setBoss();
|
this.setBoss(boss, dataSource?.bossSegments);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Overrides.OPP_STATUS_OVERRIDE) {
|
if (Overrides.OPP_STATUS_OVERRIDE) {
|
||||||
|
|
|
@ -50,6 +50,7 @@ export default class PokemonData {
|
||||||
public fusionLuck: integer;
|
public fusionLuck: integer;
|
||||||
|
|
||||||
public boss: boolean;
|
public boss: boolean;
|
||||||
|
public bossSegments?: integer;
|
||||||
|
|
||||||
public summonData: PokemonSummonData;
|
public summonData: PokemonSummonData;
|
||||||
|
|
||||||
|
@ -96,6 +97,7 @@ export default class PokemonData {
|
||||||
|
|
||||||
if (!forHistory) {
|
if (!forHistory) {
|
||||||
this.boss = (source instanceof EnemyPokemon && !!source.bossSegments) || (!this.player && !!source.boss);
|
this.boss = (source instanceof EnemyPokemon && !!source.bossSegments) || (!this.player && !!source.boss);
|
||||||
|
this.bossSegments = source.bossSegments;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sourcePokemon) {
|
if (sourcePokemon) {
|
||||||
|
|
Loading…
Reference in New Issue