From 6eaa09bf5d511810d4f806a620f4a70a55eb7670 Mon Sep 17 00:00:00 2001 From: hedara90 <90hedara@gmail.com> Date: Sat, 25 Oct 2025 14:37:17 +0200 Subject: [PATCH] Add error messages for trying to send an illegal mon to the PC and fixes index in double wild battles (#7982) Co-authored-by: Hedara --- include/strings.h | 2 ++ src/party_menu.c | 16 +++++++++++++--- src/strings.c | 2 ++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/include/strings.h b/include/strings.h index a9cddee25b..ec0072f062 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2425,5 +2425,7 @@ extern const u8 gText_Rename[]; // change nickname from summary screen // Switch Caught Mon into Party extern const u8 gText_CannotSendMonToBoxHM[]; +extern const u8 gText_CannotSendMonToBoxActive[]; +extern const u8 gText_CannotSendMonToBoxPartner[]; #endif // GUARD_STRINGS_H diff --git a/src/party_menu.c b/src/party_menu.c index 04bf04a9df..8a9532eaea 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -1512,11 +1512,21 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr) case PARTY_ACTION_SEND_MON_TO_BOX: { u8 partyId = GetPartyIdFromBattleSlot((u8)*slotPtr); - if (partyId == 0 || ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && partyId == 2) - || ((gBattleTypeFlags & BATTLE_TYPE_MULTI) && partyId >= (PARTY_SIZE / 2))) + if (partyId == 0 || ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && partyId == 1)) { - // Can't select if mon is currently on the field, or doesn't belong to you + // Can't select if mon is currently on the field PlaySE(SE_FAILURE); + DisplayPartyMenuMessage(gText_CannotSendMonToBoxActive, FALSE); + ScheduleBgCopyTilemapToVram(2); + gTasks[taskId].func = Task_ReturnToChooseMonAfterText; + } + else if ((gBattleTypeFlags & BATTLE_TYPE_MULTI) && partyId >= (PARTY_SIZE / 2)) + { + // Can't select if mon doesn't belong to you + PlaySE(SE_FAILURE); + DisplayPartyMenuMessage(gText_CannotSendMonToBoxPartner, FALSE); + ScheduleBgCopyTilemapToVram(2); + gTasks[taskId].func = Task_ReturnToChooseMonAfterText; } else if (DoesSelectedMonKnowHM((u8 *)slotPtr)) { diff --git a/src/strings.c b/src/strings.c index fd92b31e92..1c8f252fcf 100644 --- a/src/strings.c +++ b/src/strings.c @@ -1300,3 +1300,5 @@ const u8 gText_PM[] = _("PM"); const u8 gText_Relearn[] = _("{START_BUTTON} RELEARN"); // future note: don't decap this, because it mimics the summary screen BG graphics which will not get decapped const u8 gText_Rename[] = _("RENAME"); const u8 gText_CannotSendMonToBoxHM[] = _("Cannot send that mon to the box,\nbecause it knows a HM move.{PAUSE_UNTIL_PRESS}"); +const u8 gText_CannotSendMonToBoxActive[] = _("Cannot send an active battler\nto the box.{PAUSE_UNTIL_PRESS}"); +const u8 gText_CannotSendMonToBoxPartner[] = _("Cannot send a mon that doesn't,\nbelong to you to the box.{PAUSE_UNTIL_PRESS}");