Skip to content

Commit

Permalink
use proper field accesses in it_802CE308
Browse files Browse the repository at this point in the history
  • Loading branch information
wyatt-avilla committed Mar 27, 2024
1 parent 79801ba commit eaedd51
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
5 changes: 4 additions & 1 deletion src/melee/it/itCommonItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,13 @@ typedef struct HassamVars {
f32 x4;
f32 x8;
f32 xC;
u8 padding[0x5C - 0xC];
f32 x10;
f32 x14;
u8 padding[0x5C - 0x14];
f32 x5C;
f32 x60;
f32 x64;
f32 x68;
} HassamVars;

#endif
29 changes: 14 additions & 15 deletions src/melee/it/items/ithassam.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,25 +218,24 @@ bool it_802CE0C4(Item_GObj* arg0)
return 0;
}

void it_802CE308(Item_GObj* arg0)
void it_802CE308(Item_GObj* gobj)
{
Item* temp_r31;
f32 temp_f0;
void* temp_r30;

temp_r31 = arg0->user_data;
temp_r30 = temp_r31->xC4_article_data->x4_specialAttributes;
it_8027A344(arg0);
if (temp_r31->ground_or_air == GA_Air) {
temp_r31->xDD4_itemVar.pokemon.x64 -= M2C_FIELD(temp_r30, f32*, 0x14);
temp_f0 = -M2C_FIELD(temp_r30, f32*, 0x10);
if (temp_r31->xDD4_itemVar.pokemon.x64 < temp_f0) {
temp_r31->xDD4_itemVar.pokemon.x64 = temp_f0;

Item* ip = GET_ITEM(gobj);
HassamVars* attr = ip->xC4_article_data->x4_specialAttributes;

it_8027A344(gobj);
if (ip->ground_or_air == GA_Air) {
ip->xDD4_itemVar.pokemon.x64 -= attr->x14;
temp_f0 = -attr->x10;
if (ip->xDD4_itemVar.hassam.x64 < temp_f0) {
ip->xDD4_itemVar.hassam.x64 = temp_f0;
}
}
temp_r31->x40_vel.x += temp_r31->xDD4_itemVar.pokemon.timer;
temp_r31->x40_vel.y += temp_r31->xDD4_itemVar.pokemon.x64;
temp_r31->x40_vel.z += temp_r31->xDD4_itemVar.PKThunderVars.xE38.z;
ip->x40_vel.x += ip->xDD4_itemVar.hassam.x60;
ip->x40_vel.y += ip->xDD4_itemVar.hassam.x64;
ip->x40_vel.z += ip->xDD4_itemVar.hassam.x68;
}

bool it_802CE3A8(Item_GObj* gobj)
Expand Down

0 comments on commit eaedd51

Please sign in to comment.