Move trapped messages into a .then() statement

This commit is contained in:
Wlowscha 2025-08-18 23:51:44 +02:00
parent 7131e1fb01
commit 711043ac54
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04

View File

@ -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);