Skip to content

Commit

Permalink
match it_80293164 but w/ gotos
Browse files Browse the repository at this point in the history
  • Loading branch information
wyatt-avilla committed Mar 21, 2024
1 parent b9bd3a6 commit 17e43ef
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
5 changes: 5 additions & 0 deletions src/melee/it/itCommonItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,9 @@ typedef struct CoinVars {
int x14;
} CoinVars;

typedef struct FFlowerVars {
int x0;
int x4;
} FFlowerVars;

#endif
34 changes: 16 additions & 18 deletions src/melee/it/items/itfflower.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,32 +203,30 @@ void it_8029313C(Item_GObj* gobj)
Item_80268E5C(gobj, 1, ITEM_ANIM_UPDATE);
}

bool it_80293164(Item_GObj* arg0)
bool it_80293164(Item_GObj* gobj)
{
s32 temp_r0;
void* temp_r31;
Item* ip = GET_ITEM(gobj);
enum_t msid = ip->msid;

temp_r31 = arg0->user_data;
temp_r0 = M2C_FIELD(temp_r31, s32*, 0x24);
if (temp_r0 != 4) {
if (temp_r0 < 4) {
if (temp_r0 < 0) {
} else {
if (msid != 4) {
if (msid < 4) {
if (msid >= 0) {
goto block_5;
}
} else if (temp_r0 < 8) {
} else if (msid < 8) {
block_5:
efLib_DestroyAll(arg0);
M2C_FIELD(temp_r31, s32*, 0xDD8) = 0;
efLib_DestroyAll(gobj);
ip->xDD4_itemVar.fflower.x4 = 0;
}
} else if (M2C_FIELD(temp_r31, s32*, 0xD4C) <= 0) {
efLib_DestroyAll(arg0);
M2C_FIELD(temp_r31, s32*, 0xDD8) = 0;
} else if (ip->xD4C <= 0) {
efLib_DestroyAll(gobj);
ip->xDD4_itemVar.fflower.x4 = 0;
}
if (it_80272C6C(arg0) == 0) {
Item_80268E5C(arg0, 1, ITEM_ANIM_UPDATE);

if (it_80272C6C(gobj) == false) {
Item_80268E5C(gobj, 1, ITEM_ANIM_UPDATE);
}
return 0;
return false;
}

void it_80293210(Item_GObj* gobj)
Expand Down
1 change: 1 addition & 0 deletions src/melee/it/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ struct Item {
itShellVars shell;
itTargetVars target;
CoinVars coin;
FFlowerVars fflower;
u8 padding[0xFCC - 0xDD4];
} xDD4_itemVar;
};
Expand Down

0 comments on commit 17e43ef

Please sign in to comment.