Update item_menu.c

Don't use signed values for unsigned variables
This commit is contained in:
DizzyEggg 2018-09-02 00:28:03 +02:00 committed by GitHub
parent 4418189d4c
commit 23aab35b96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -675,7 +675,7 @@ void sub_81AB520(u8 rboxId, int item_index_in_pocket, u8 a)
} }
itemId = BagGetItemIdByPocketPosition(gUnknown_0203CE58.pocket + 1, item_index_in_pocket); itemId = BagGetItemIdByPocketPosition(gUnknown_0203CE58.pocket + 1, item_index_in_pocket);
itemQuantity = BagGetQuantityByPocketPosition(gUnknown_0203CE58.pocket + 1, item_index_in_pocket); itemQuantity = BagGetQuantityByPocketPosition(gUnknown_0203CE58.pocket + 1, item_index_in_pocket);
if ((u16)(itemId - ITEM_HM01) <= 7) if (itemId >= ITEM_HM01 && itemId <= ITEM_HM08)
BlitBitmapToWindow(rboxId, gBagMenuHMIcon_Gfx, 8, a - 1, 16, 16); BlitBitmapToWindow(rboxId, gBagMenuHMIcon_Gfx, 8, a - 1, 16, 16);
if (gUnknown_0203CE58.pocket == 3) if (gUnknown_0203CE58.pocket == 3)
{ {
@ -701,10 +701,10 @@ void sub_81AB520(u8 rboxId, int item_index_in_pocket, u8 a)
void bag_menu_print_description_box_text(int a) void bag_menu_print_description_box_text(int a)
{ {
u8* str; const u8 *str;
if (a != -2) if (a != -2)
{ {
str = (u8*)ItemId_GetDescription(BagGetItemIdByPocketPosition(gUnknown_0203CE58.pocket + 1, a)); str = ItemId_GetDescription(BagGetItemIdByPocketPosition(gUnknown_0203CE58.pocket + 1, a));
} }
else else
{ {
@ -2103,9 +2103,9 @@ void setup_bag_menu_textboxes(void)
InitWindows(gUnknown_08614174); InitWindows(gUnknown_08614174);
DeactivateAllTextPrinters(); DeactivateAllTextPrinters();
LoadUserWindowBorderGfx(0, 1, -32); LoadUserWindowBorderGfx(0, 1, 0xE0);
LoadMessageBoxGfx(0, 10, -48); LoadMessageBoxGfx(0, 10, 0xD0);
sub_819A2BC(-64, 1); sub_819A2BC(0xC0, 1);
LoadPalette(&gUnknown_0860F074, 0xF0, 0x20); LoadPalette(&gUnknown_0860F074, 0xF0, 0x20);
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{ {