Skip to content

Commit

Permalink
Add better error checking to form drawing
Browse files Browse the repository at this point in the history
  • Loading branch information
piepie62 committed Jan 5, 2019
1 parent 491220f commit 809c281
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/gui/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,9 @@ void Gui::pkm(int species, int form, Generation generation, int x, int y, float

switch (species)
{
default:
C2D_DrawImageAt(C2D_SpriteSheetGetImage(spritesheet_pkm, species), x, y, 0.5f, &tint, scale, scale);
return;
case 801:
imageOffsetFromBack += 3;
case 800:
Expand Down Expand Up @@ -1233,6 +1236,8 @@ void Gui::pkm(int species, int form, Generation generation, int x, int y, float
imageOffsetFromBack += 2;
case 6:
imageOffsetFromBack += 1;
case 3:
imageOffsetFromBack += 0;
}
int drawIndex = types_spritesheet_beast_idx + imageOffsetFromBack + form;
if (drawIndex < types_spritesheet_201_1_idx)
Expand Down

0 comments on commit 809c281

Please sign in to comment.