Remove unnecessary subtraction in switch

This commit is contained in:
GriffinR 2021-01-04 19:50:05 -05:00
parent 5cf5adf7d7
commit eba7933c0c

View File

@ -1221,16 +1221,16 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr)
} }
else else
{ {
switch (gPartyMenu.action - 3) switch (gPartyMenu.action)
{ {
case PARTY_ACTION_SOFTBOILED - 3: case PARTY_ACTION_SOFTBOILED:
if (IsSelectedMonNotEgg((u8*)slotPtr)) if (IsSelectedMonNotEgg((u8*)slotPtr))
{ {
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[1]); PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[1]);
Task_TryUseSoftboiledOnPartyMon(taskId); Task_TryUseSoftboiledOnPartyMon(taskId);
} }
break; break;
case PARTY_ACTION_USE_ITEM - 3: case PARTY_ACTION_USE_ITEM:
if (IsSelectedMonNotEgg((u8*)slotPtr)) if (IsSelectedMonNotEgg((u8*)slotPtr))
{ {
if (gPartyMenu.menuType == PARTY_MENU_TYPE_IN_BATTLE) if (gPartyMenu.menuType == PARTY_MENU_TYPE_IN_BATTLE)
@ -1240,7 +1240,7 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr)
gItemUseCB(taskId, Task_ClosePartyMenuAfterText); gItemUseCB(taskId, Task_ClosePartyMenuAfterText);
} }
break; break;
case PARTY_ACTION_MOVE_TUTOR - 3: case PARTY_ACTION_MOVE_TUTOR:
if (IsSelectedMonNotEgg((u8*)slotPtr)) if (IsSelectedMonNotEgg((u8*)slotPtr))
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
@ -1248,7 +1248,7 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr)
TryTutorSelectedMon(taskId); TryTutorSelectedMon(taskId);
} }
break; break;
case PARTY_ACTION_GIVE_MAILBOX_MAIL - 3: case PARTY_ACTION_GIVE_MAILBOX_MAIL:
if (IsSelectedMonNotEgg((u8*)slotPtr)) if (IsSelectedMonNotEgg((u8*)slotPtr))
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
@ -1256,8 +1256,8 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr)
TryGiveMailToSelectedMon(taskId); TryGiveMailToSelectedMon(taskId);
} }
break; break;
case PARTY_ACTION_GIVE_ITEM - 3: case PARTY_ACTION_GIVE_ITEM:
case PARTY_ACTION_GIVE_PC_ITEM - 3: case PARTY_ACTION_GIVE_PC_ITEM:
if (IsSelectedMonNotEgg((u8*)slotPtr)) if (IsSelectedMonNotEgg((u8*)slotPtr))
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
@ -1265,23 +1265,23 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr)
TryGiveItemOrMailToSelectedMon(taskId); TryGiveItemOrMailToSelectedMon(taskId);
} }
break; break;
case PARTY_ACTION_SWITCH - 3: case PARTY_ACTION_SWITCH:
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
SwitchSelectedMons(taskId); SwitchSelectedMons(taskId);
break; break;
case PARTY_ACTION_CHOOSE_AND_CLOSE - 3: case PARTY_ACTION_CHOOSE_AND_CLOSE:
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
Task_ClosePartyMenu(taskId); Task_ClosePartyMenu(taskId);
break; break;
case PARTY_ACTION_MINIGAME - 3: case PARTY_ACTION_MINIGAME:
if (IsSelectedMonNotEgg((u8*)slotPtr)) if (IsSelectedMonNotEgg((u8*)slotPtr))
{ {
TryEnterMonForMinigame(taskId, (u8)*slotPtr); TryEnterMonForMinigame(taskId, (u8)*slotPtr);
} }
break; break;
default: default:
case PARTY_ACTION_ABILITY_PREVENTS - 3: case PARTY_ACTION_ABILITY_PREVENTS:
case PARTY_ACTION_SWITCHING - 3: case PARTY_ACTION_SWITCHING:
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
Task_TryCreateSelectionWindow(taskId); Task_TryCreateSelectionWindow(taskId);
break; break;