summaryrefslogtreecommitdiff
path: root/src/kangaskhan_storage_2.c
diff options
context:
space:
mode:
authorDennis <dhilhorst2000@gmail.com>2021-07-10 18:23:20 +0200
committerGitHub <noreply@github.com>2021-07-10 11:23:20 -0500
commit92a8e55fdd348a88a365eb389181d8e29da6dad9 (patch)
tree2467ef22cb8cf75bdf056143fab3fac4a68ef404 /src/kangaskhan_storage_2.c
parent386299d1f401cb939e6fe3ea16d0ca57731b2648 (diff)
Decompiled some item related functions (#42)
* 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 Co-authored-by: Seth Barberee <seth.barberee@gmail.com>
Diffstat (limited to 'src/kangaskhan_storage_2.c')
-rw-r--r--src/kangaskhan_storage_2.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/kangaskhan_storage_2.c b/src/kangaskhan_storage_2.c
index 02059d1..9155ef3 100644
--- a/src/kangaskhan_storage_2.c
+++ b/src/kangaskhan_storage_2.c
@@ -3,18 +3,18 @@
#include "memory.h"
#include "text.h"
#include "item.h"
-#include "gUnknown_203B460.h"
+#include "team_inventory.h"
#include "input.h"
#include "kangaskhan_storage.h"
extern struct unkStruct_203B208 *gUnknown_203B208;
-extern struct unkStruct_203B460 *gUnknown_203B460;
+extern struct TeamInventory *gTeamInventory_203B460;
struct unkStruct_203B20C
{
u32 state;
u8 unk4[4];
- struct ItemStruct_203B460 unk8;
+ struct ItemSlot unk8;
u8 fillC[0x14 - 0xC];
u32 unk14;
u32 unk18;
@@ -60,7 +60,7 @@ extern u8 sub_8012FD8(u32 *r0);
extern void sub_8013114(u32 *, s32 *);
extern void sub_801CBB8();
-extern bool8 sub_8091524(u8);
+extern bool8 IsNotMoneyOrUsedTMItem(u8);
extern bool8 sub_801ADA0(u32);
extern void sub_8099690(u32);
extern u32 sub_8013BBC(u32 *);
@@ -90,7 +90,7 @@ extern void sub_801CCD8();
extern void sub_80184D4();
extern void sub_8018280();
extern void sub_8013AA0(u32 *);
-extern void sub_801B3C0(struct ItemStruct_203B460 *);
+extern void sub_801B3C0(struct ItemSlot *);
extern void sub_801A5D8(u32, u32, u32, u32);
extern void sub_801C8C4(u32, u32, u32, u32);
extern void sub_8012D60(u32 *, u32 *, u32, u16 *, u32, u32);
@@ -117,13 +117,13 @@ void sub_8017AF8(void)
else
{
gUnknown_203B208->unk10 = sub_801A8AC();
- gUnknown_203B208->unkC = gUnknown_203B460->fill0[gUnknown_203B208->unk10];
+ gUnknown_203B208->unkC = gTeamInventory_203B460->teamItems[gUnknown_203B208->unk10];
UpdateKangaskhanStorageState(0xF);
}
break;
case 4:
gUnknown_203B208->unk10 = sub_801A8AC();
- gUnknown_203B208->unkC = gUnknown_203B460->fill0[gUnknown_203B208->unk10];
+ gUnknown_203B208->unkC = gTeamInventory_203B460->teamItems[gUnknown_203B208->unk10];
UpdateKangaskhanStorageState(0x10);
break;
case 2:
@@ -201,7 +201,7 @@ void sub_8017C7C(void)
{
case 2:
sub_8099690(0);
- if(!sub_8091524(gUnknown_203B208->unkC.itemIndex))
+ if(!IsNotMoneyOrUsedTMItem(gUnknown_203B208->unkC.itemIndex))
UpdateKangaskhanStorageState(9);
else
if(!sub_801ADA0(gUnknown_203B208->unk10))
@@ -232,14 +232,14 @@ void sub_8017D24(void)
switch(menuAction)
{
case 3:
- if (sub_8090A34() > 0x13)
+ if (GetNumberOfFilledInventorySlots() > 0x13)
{
sub_801CBB8();
UpdateKangaskhanStorageState(6);
}
else
{
- if(sub_8090A60(gUnknown_203B208->unkC.itemIndex))
+ if(IsThrowableItem(gUnknown_203B208->unkC.itemIndex))
UpdateKangaskhanStorageState(0x18);
else
UpdateKangaskhanStorageState(0x1B);
@@ -444,10 +444,10 @@ void sub_8018100(void)
case 12:
gUnknown_203B20C->unkD0 = 2;
gUnknown_203B20C->unkC8 = 1;
- if(gUnknown_203B460->unk50[gUnknown_203B20C->unk8.itemIndex] > 99)
+ if(gTeamInventory_203B460->unk50[gUnknown_203B20C->unk8.itemIndex] > 99)
gUnknown_203B20C->unkCC = 99;
else
- gUnknown_203B20C->unkCC = gUnknown_203B460->unk50[gUnknown_203B20C->unk8.itemIndex];
+ gUnknown_203B20C->unkCC = gTeamInventory_203B460->unk50[gUnknown_203B20C->unk8.itemIndex];
gUnknown_203B20C->unkC4 = gUnknown_203B20C->unkCC;
gUnknown_203B20C->unkD4 = 1;
gUnknown_203B20C->unkD8 = &gUnknown_203B20C->unkF0[1];