diff options
Diffstat (limited to 'src/pokemon_storage_system.c')
-rw-r--r-- | src/pokemon_storage_system.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 87180ad1e..a58187d8b 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -4687,7 +4687,7 @@ static bool8 UpdateBoxMonIconScroll(void) // Create the new incoming column of icons sStorage->iconScrollPos += sStorage->iconScrollSpeed; sStorage->iconScrollNumIncoming += CreateBoxMonIconsInColumn(sStorage->iconScrollCurColumn, sStorage->iconScrollDistance, sStorage->iconScrollSpeed); - + if ((sStorage->iconScrollDirection > 0 && sStorage->iconScrollCurColumn == IN_BOX_COLUMNS - 1) || (sStorage->iconScrollDirection < 0 && sStorage->iconScrollCurColumn == 0)) { @@ -5050,7 +5050,7 @@ static void SetReleaseMon(u8 mode, u8 position) static bool8 TryHideReleaseMonSprite(void) { - if (*sStorage->releaseMonSpritePtr == NULL + if (*sStorage->releaseMonSpritePtr == NULL || (*sStorage->releaseMonSpritePtr)->invisible) return FALSE; @@ -5903,7 +5903,7 @@ static bool8 UpdateCursorPos(void) sStorage->cursorNewY += sStorage->cursorSpeedY; sStorage->cursorSprite->x = sStorage->cursorNewX >> 8; sStorage->cursorSprite->y = sStorage->cursorNewY >> 8; - + // Limit cursor on right if (sStorage->cursorSprite->x > DISPLAY_WIDTH + 16) { @@ -6525,7 +6525,7 @@ static void GetRestrictedReleaseMoves(u16 *moves) for (i = 0; i < ARRAY_COUNT(sRestrictedReleaseMoves); i++) { if (sRestrictedReleaseMoves[i].mapGroup == MAP_GROUPS_COUNT - || (sRestrictedReleaseMoves[i].mapGroup == gSaveBlock1Ptr->location.mapGroup + || (sRestrictedReleaseMoves[i].mapGroup == gSaveBlock1Ptr->location.mapGroup && sRestrictedReleaseMoves[i].mapNum == gSaveBlock1Ptr->location.mapNum)) { *moves = sRestrictedReleaseMoves[i].move; @@ -6589,7 +6589,7 @@ static bool32 AtLeastThreeUsableMons(void) { s32 i, j; s32 count = (sIsMonBeingMoved != FALSE); - + // Check party for usable Pokémon for (j = 0; j < PARTY_SIZE; j++) { @@ -6660,7 +6660,7 @@ static s8 RunCanReleaseMon(void) for (i = 0; i < IN_BOX_COUNT; i++) { knownMoves = GetAndCopyBoxMonDataAt(sStorage->releaseCheckBoxId, sStorage->releaseCheckBoxPos, MON_DATA_KNOWN_MOVES, (u8*)sStorage->restrictedMoveList); - if (knownMoves != 0 && !(sStorage->releaseBoxId == sStorage->releaseCheckBoxId + if (knownMoves != 0 && !(sStorage->releaseBoxId == sStorage->releaseCheckBoxId && sStorage->releaseBoxPos == sStorage->releaseCheckBoxPos)) { // Found PC Pokémon with restricted move, clear move from list @@ -7537,7 +7537,7 @@ static u8 HandleInput_OnButtons(void) sStorage->cursorVerticalWrap = -1; if (sCursorPosition == 0) cursorPosition = IN_BOX_COUNT - 1 - 5; - else + else cursorPosition = IN_BOX_COUNT - 1; sStorage->cursorFlipTimer = 1; break; @@ -7570,7 +7570,7 @@ static u8 HandleInput_OnButtons(void) // Button was pressed, determine which if (JOY_NEW(A_BUTTON)) return (cursorPosition == 0) ? INPUT_SHOW_PARTY : INPUT_CLOSE_BOX; - + if (JOY_NEW(B_BUTTON)) return INPUT_PRESSED_B; @@ -8084,9 +8084,9 @@ static void RemoveMenu(void) //------------------------------------------------------------------------------ // SECTION: MultiMove -// +// // The functions below handle moving and selecting multiple Pokémon at once. -// The icon sprites are moved to bg 0, and this bg is manipulated to move +// The icon sprites are moved to bg 0, and this bg is manipulated to move // them as a group. //------------------------------------------------------------------------------ @@ -8644,7 +8644,7 @@ static bool8 MultiMove_CanPlaceSelection(void) //------------------------------------------------------------------------------ // SECTION: Item mode -// +// // The functions below handle the Move Items mode //------------------------------------------------------------------------------ @@ -8950,7 +8950,7 @@ static void MoveItemFromCursorToBag(void) // The party menu is being closed, if the cursor is on // a Pokémon that has a held item make sure it slides -// up along with the closing menu. +// up along with the closing menu. static void MoveHeldItemWithPartyMenu(void) { s32 i; @@ -8960,7 +8960,7 @@ static void MoveHeldItemWithPartyMenu(void) for (i = 0; i < MAX_ITEM_ICONS; i++) { - if (sStorage->itemIcons[i].active + if (sStorage->itemIcons[i].active && sStorage->itemIcons[i].area == CURSOR_AREA_IN_PARTY) SetItemIconCallback(i, ITEM_CB_HIDE_PARTY, CURSOR_AREA_IN_HAND, 0); } @@ -8974,10 +8974,10 @@ static bool8 IsItemIconAnimActive(void) { if (sStorage->itemIcons[i].active) { - if (!sStorage->itemIcons[i].sprite->affineAnimEnded + if (!sStorage->itemIcons[i].sprite->affineAnimEnded && sStorage->itemIcons[i].sprite->affineAnimBeginning) return TRUE; - if (sStorage->itemIcons[i].sprite->callback != SpriteCallbackDummy + if (sStorage->itemIcons[i].sprite->callback != SpriteCallbackDummy && sStorage->itemIcons[i].sprite->callback != SpriteCB_ItemIcon_SetPosToCursor) return TRUE; } @@ -8993,7 +8993,7 @@ static bool8 IsMovingItem(void) { for (i = 0; i < MAX_ITEM_ICONS; i++) { - if (sStorage->itemIcons[i].active + if (sStorage->itemIcons[i].active && sStorage->itemIcons[i].area == CURSOR_AREA_IN_HAND) return TRUE; } @@ -9988,7 +9988,7 @@ static void TilemapUtil_Draw(u8 id) //------------------------------------------------------------------------------ // SECTION: UnkUtil -// +// // Some data transfer utility that goes functionally unused. // It gets initialized with UnkUtil_Init, and run every vblank in Pokémon // Storage with UnkUtil_Run, but neither of the Add functions are ever used, |