mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-04-29 04:55:24 +01:00
[Refactor] Delete stale pokemon objects at the end of a battle
This commit is contained in:
commit
b3a4c75c06
@ -73,6 +73,13 @@ export class BattleEndPhase extends BattlePhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
globalScene.clearEnemyHeldItemModifiers();
|
globalScene.clearEnemyHeldItemModifiers();
|
||||||
|
for (const p of globalScene.getEnemyParty()) {
|
||||||
|
try {
|
||||||
|
p.destroy();
|
||||||
|
} catch {
|
||||||
|
console.warn("Unable to destroy stale pokemon object in BattleEndPhase:", p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const lapsingModifiers = globalScene.findModifiers(
|
const lapsingModifiers = globalScene.findModifiers(
|
||||||
m => m instanceof LapsingPersistentModifier || m instanceof LapsingPokemonHeldItemModifier,
|
m => m instanceof LapsingPersistentModifier || m instanceof LapsingPokemonHeldItemModifier,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user