summaryrefslogtreecommitdiff
path: root/src/items.c
diff options
context:
space:
mode:
authorDennis <dhilhorst2000@gmail.com>2021-07-12 21:10:32 +0200
committerGitHub <noreply@github.com>2021-07-12 14:10:32 -0500
commitda7b30612f2cac57da0ffe09d1d7c42e309d15f2 (patch)
treee82dbc33b112798b308e8c001eb3979cab69aa05 /src/items.c
parent2104c4f7623f2bfc94130d25f2c903fa54991676 (diff)
More work on item related functions (#44)
* decompile sub_8091290 * decompile sub_80912c8 * rename functions / struct field * more names * decompile 80913A0 * decompile GetItemMove * decompile sub_80913E0 * rename function * decompile CanSellItem function * rename inventory struct * add some item check functions * fix renaming stuff * this file shouldnt have been here * forgot merge conflict * decompile more item functions * rename some stuff * fix HM/TM naming * Update src/code_801AFA4.c Use enum value for USED_TM * Fix incorrect value * decompile sub_80915F4 * decompile HasGummiItem * decompiled another function and renamed stuff * decompile 2 smaller functions * more functions * more decompiling and renaming * redo change that was undone in the merge
Diffstat (limited to 'src/items.c')
-rw-r--r--src/items.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/items.c b/src/items.c
index f7bd24e..8b2de3f 100644
--- a/src/items.c
+++ b/src/items.c
@@ -3,16 +3,17 @@
#include "item.h"
#include "team_inventory.h"
#include "random.h"
+#include "pokemon.h"
extern struct TeamInventory *gTeamInventory_203B460;
extern struct TeamInventory gUnknown_20389A8;
extern struct FileArchive gSystemFileArchive;
extern const char gUnknown_8109764;
+extern u16 *gGummiStatBoostLUT;
EWRAM_DATA struct OpenedFile *gItemParametersFile;
EWRAM_DATA struct Item *gItemParametersData;
-extern void sub_8091840(u8);
extern u8 GetItemType(u8);
extern u32 GetItemUnkThrow(u8, u32);
extern bool8 CanSellItem(u8);
@@ -34,19 +35,19 @@ void InitializeMoneyItems(void)
{
s32 i;
- for(i = 0; i < 20; i++)
+ for(i = 0; i < INVENTORY_SIZE; i++)
{
gTeamInventory_203B460->teamItems[i].unk0 = 0;
}
for(i = 0; i < 0xF0; i++)
{
- gTeamInventory_203B460->unk50[i] = 0;
+ gTeamInventory_203B460->teamStorage[i] = 0;
}
for(i = 0; i < 8; i++)
{
- sub_8091840(i);
+ xxx_init_unk230_substruct(i);
}
gTeamInventory_203B460->teamMoney = 0;
gTeamInventory_203B460->teamSavings = 0;
@@ -58,7 +59,7 @@ s32 GetNumberOfFilledInventorySlots(void)
s32 count;
count = 0;
- for(i = 0; i < 20; i++)
+ for(i = 0; i < INVENTORY_SIZE; i++)
{
if ((gTeamInventory_203B460->teamItems[i].unk0 & 1) != 0) {
count++;
@@ -293,4 +294,4 @@ void sub_8090DC4(void* param_1,u8 itemIndex,u32 param_3)
sub_8090A8C(&unkItem,itemIndex,0);
unkItem.numItems = 1;
sub_8090F58(param_1,acStack104,&unkItem,param_3);
-} \ No newline at end of file
+}