Rewrote GetItemIconPicOrPalette (again) to factor in customized HM counts (#4487)
* GetItemIconPicOrPalette factors custom HM counts * remove the extra else
This commit is contained in:
parent
5538095785
commit
0a64ab1298
1 changed files with 10 additions and 9 deletions
|
@ -162,15 +162,16 @@ u8 AddCustomItemIconSprite(const struct SpriteTemplate *customSpriteTemplate, u1
|
|||
const void *GetItemIconPicOrPalette(u16 itemId, u8 which)
|
||||
{
|
||||
if (itemId == ITEM_LIST_END)
|
||||
itemId = ITEMS_COUNT; // Use last icon, the "return to field" arrow
|
||||
else if (itemId >= ITEMS_COUNT)
|
||||
itemId = 0;
|
||||
else if (itemId >= ITEM_TM01 && itemId <= ITEM_HM08 && which)
|
||||
return gTypesInfo[gMovesInfo[gItemsInfo[itemId].secondaryId].type].paletteTMHM;
|
||||
else if (itemId >= ITEM_TM01 && itemId < ITEM_HM01)
|
||||
return gItemIcon_TM;
|
||||
else if (itemId >= ITEM_HM01 && itemId <= ITEM_HM08)
|
||||
return gItemIconTable[ITEMS_COUNT][which]; // Use last icon, the "return to field" arrow
|
||||
if (itemId >= ITEMS_COUNT)
|
||||
return gItemIconTable[0][which];
|
||||
if (itemId >= ITEM_TM01 && itemId < ITEM_HM01 + NUM_HIDDEN_MACHINES)
|
||||
{
|
||||
if (which)
|
||||
return gTypesInfo[gMovesInfo[gItemsInfo[itemId].secondaryId].type].paletteTMHM;
|
||||
if (itemId < ITEM_TM01 + NUM_TECHNICAL_MACHINES)
|
||||
return gItemIcon_TM;
|
||||
return gItemIcon_HM;
|
||||
|
||||
}
|
||||
return gItemIconTable[itemId][which];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue