Skip to content

Commit

Permalink
Fixed Battle AI debug screen shiny sprites (rh-hideout#3922)
Browse files Browse the repository at this point in the history
* Switched gBattleMons.isShiny to GetMonData

* Simplified getting party of Pokemon

---------

Co-authored-by: Alex <[email protected]>
  • Loading branch information
fdeblasio and AlexOn1ine authored Jan 4, 2024
1 parent 4d5c572 commit bfe3e76
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/battle_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,7 @@ static void Task_ShowAiPoints(u8 taskId)
u32 i, count;
struct WindowTemplate winTemplate;
struct BattleDebugMenu *data = GetStructPtr(taskId);
struct Pokemon *mon;

switch (data->aiViewState)
{
Expand Down Expand Up @@ -800,8 +801,11 @@ static void Task_ShowAiPoints(u8 taskId)
data->spriteIds.aiIconSpriteIds[i] = 0xFF;
}
}

mon = &GetBattlerParty(data->aiBattlerId)[gBattlerPartyIndexes[data->aiBattlerId]];

data->aiMonSpriteId = CreateMonPicSprite(gBattleMons[data->aiBattlerId].species,
gBattleMons[data->aiBattlerId].isShiny,
GetMonData(mon, MON_DATA_IS_SHINY),
gBattleMons[data->aiBattlerId].personality,
TRUE,
39, 130, 15, TAG_NONE);
Expand Down Expand Up @@ -926,6 +930,7 @@ static void Task_ShowAiKnowledge(u8 taskId)
u32 i, count;
struct WindowTemplate winTemplate;
struct BattleDebugMenu *data = GetStructPtr(taskId);
struct Pokemon *mon;

switch (data->aiViewState)
{
Expand Down Expand Up @@ -957,8 +962,11 @@ static void Task_ShowAiKnowledge(u8 taskId)
data->spriteIds.aiIconSpriteIds[i] = 0xFF;
}
}

mon = &GetBattlerParty(data->aiBattlerId)[gBattlerPartyIndexes[data->aiBattlerId]];

data->aiMonSpriteId = CreateMonPicSprite(gBattleMons[data->aiBattlerId].species,
gBattleMons[data->aiBattlerId].isShiny,
GetMonData(mon, MON_DATA_IS_SHINY),
gBattleMons[data->aiBattlerId].personality,
TRUE,
39, 130, 15, TAG_NONE);
Expand Down

0 comments on commit bfe3e76

Please sign in to comment.