Skip to content

Commit

Permalink
Clean up struct definition
Browse files Browse the repository at this point in the history
  • Loading branch information
ribbanya committed Feb 22, 2024
1 parent ce6e5a9 commit e4c16fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
12 changes: 6 additions & 6 deletions src/melee/it/itCommonItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ typedef struct {
u32 x0;
} ItLGunVars;

typedef struct EggVars // Eggs spawned on Yoshi stages / by Chansey
{
bool x0;
int rand_max;
u8 filler[0x58];
s32 xE34_heal;
/// Eggs spawned on Yoshi stages / by Chansey
typedef struct EggVars {
/* +0 */ bool x0;
/* +4 */ int rand_max;
/* +8 */ u8 _8[0x60 - 0x8];
/* +60 */ int heal_amount;
} EggVars;

typedef struct WhispyAppleVars {
Expand Down
18 changes: 6 additions & 12 deletions src/melee/it/items/itegg.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ void it_80288D98(Item_GObj* gobj)
bool it_80288DC4(Item_GObj* gobj)
{
Item* ip = GET_ITEM(gobj);
struct EggVars* vars = ip->xC4_article_data->x4_specialAttributes;
if (HSD_Randi(vars->rand_max) == 0) {
EggVars* attrs = ip->xC4_article_data->x4_specialAttributes;
if (HSD_Randi(attrs->rand_max) == 0) {
return true;
}

Expand All @@ -102,7 +102,7 @@ bool it_80288DC4(Item_GObj* gobj)
}
}

it_8026F3D4(gobj, 0, vars->x0, 0);
it_8026F3D4(gobj, 0, attrs->x0, 0);
return false;
}

Expand Down Expand Up @@ -236,15 +236,9 @@ void it_80289158(Item_GObj* gobj)

bool it_802891E0(Item_GObj* gobj)
{
Item* item = GET_ITEM(gobj);

item->xDD4_itemVar.Egg.rand_max -= 1;

if (item->xDD4_itemVar.Egg.rand_max > 0) {
return false;
} else {
return true;
}
Item* ip = GET_ITEM(gobj);
--ip->xDD4_itemVar.egg.rand_max;
return ip->xDD4_itemVar.egg.rand_max > 0 ? false : true;
}

void it_8028920C(Item_GObj* gobj) {}
Expand Down

0 comments on commit e4c16fd

Please sign in to comment.