mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-19 13:59:27 +02:00
[Bug][P1] Fix trapping abilities crashing game on switch out (#6293)
Move trapped messages into a .then() statement
This commit is contained in:
parent
5500f2ff8d
commit
3d9cb539c7
@ -474,20 +474,21 @@ export class CommandPhase extends FieldPhase {
|
||||
}
|
||||
if (trappedAbMessages.length > 0) {
|
||||
if (isSwitch) {
|
||||
globalScene.ui.setMode(UiMode.MESSAGE);
|
||||
globalScene.ui.setMode(UiMode.MESSAGE).then(() => {
|
||||
globalScene.ui.showText(
|
||||
trappedAbMessages[0],
|
||||
null,
|
||||
() => {
|
||||
globalScene.ui.showText("", 0);
|
||||
if (isSwitch) {
|
||||
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||
}
|
||||
},
|
||||
null,
|
||||
true,
|
||||
);
|
||||
});
|
||||
}
|
||||
globalScene.ui.showText(
|
||||
trappedAbMessages[0],
|
||||
null,
|
||||
() => {
|
||||
globalScene.ui.showText("", 0);
|
||||
if (isSwitch) {
|
||||
globalScene.ui.setMode(UiMode.COMMAND, this.fieldIndex);
|
||||
}
|
||||
},
|
||||
null,
|
||||
true,
|
||||
);
|
||||
} else {
|
||||
const trapTag = playerPokemon.getTag(TrappedTag);
|
||||
const fairyLockTag = globalScene.arena.getTagOnSide(ArenaTagType.FAIRY_LOCK, ArenaTagSide.PLAYER);
|
||||
|
Loading…
Reference in New Issue
Block a user