Skip to content

Commit 54b9591

Browse files
AaronB-Hubribbanya
authored andcommitted
Variable documentation
1 parent 73375ea commit 54b9591

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

src/melee/it/itCommonItems.h

+11-14
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,8 @@ typedef struct FoodVars {
122122

123123
typedef struct ItLGunAttr {
124124
int x0;
125-
float x4;
126-
float x8;
127-
float xC;
128-
} ItLGunAttr; // Not sure if this struct size is correct or type of vars
125+
Vec3 pos;
126+
} ItLGunAttr;
129127

130128
typedef struct ItLGunVars {
131129
int x0;
@@ -140,27 +138,26 @@ typedef struct ItLGunBeamAttr {
140138
} ItLGunBeamAttr; // Not sure if this struct size is correct or type of vars
141139

142140
typedef struct ItLGunBeamVars {
143-
/* x0 */ Vec3 xDD4; //
144-
/* xC */ Vec3 xDE0; //
145-
/* x18 */ Vec3 xDEC; //
146-
/* x24 */ f32 xDF8; //
147-
/* x28 */ f32 xDFC; //
148-
/* x2C */ f32 xE00; //
149-
/* x30 */ f32 xE04; //
141+
/* x0 */ Vec3 xDD4; // pos
142+
/* xC */ Vec3 xDE0; // position
143+
/* x18 */ Vec3 xDEC; // position
144+
/* x24 */ f32 xDF8; // angle?
145+
/* x28 */ f32 xDFC; // angle?
146+
/* x2C */ f32 xE00; // lifetime?
147+
/* x30 */ f32 xE04; // ??
150148
} ItLGunBeamVars;
151149

152150
typedef struct ItLGunRayAttr {
153151
float speed;
154152
float lifetime;
155-
float x8;
156-
float xC;
153+
float x8; // reference scale value?
157154
} ItLGunRayAttr;
158155

159156
typedef struct ItLGunRayVars {
160157
/* ip+DD4 */ float scale;
161158
/* ip+DD8 */ float angle;
162159
/* ip+DDC */ float speed;
163-
/* ip+DE0 */ Vec3 xC;
160+
/* ip+DE0 */ Vec3 pos;
164161
} ItLGunRayVars;
165162

166163
/// Eggs spawned on Yoshi stages / by Chansey

src/melee/it/items/itlgun.c

+9-6
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ void it_8028E738(Item_GObj* gobj)
4343
Item* ip = gobj->user_data;
4444
ItLGunAttr* item_spec_attr = ip->xC4_article_data->x4_specialAttributes;
4545
ip->xD4C = item_spec_attr->x0;
46-
ip->xDD4_itemVar.capsule.x0 = false;
46+
ip->xDD4_itemVar.lgun.x0 = false;
4747
it_8028E860(gobj);
4848
}
4949

5050
void it_8028E774(Item_GObj* gobj, Vec3* arg1)
5151
{
5252
ItLGunAttr* da = GET_ITEM(gobj)->xC4_article_data->x4_specialAttributes;
53-
arg1->x = da->x4;
54-
arg1->y = da->x8;
55-
arg1->z = da->xC;
53+
arg1->x = da->pos.x;
54+
arg1->y = da->pos.y;
55+
arg1->z = da->pos.z;
5656
}
5757

5858
void it_8028E79C(Item_GObj* gobj, Vec3* pos, f32 facing_dir)
@@ -125,14 +125,17 @@ void it_8028E934(HSD_GObj* gobj) {}
125125

126126
void it_8028E938(Item_GObj* gobj)
127127
{
128-
GET_ITEM(gobj)->xDD4_itemVar.lgun.x0 = 40;
128+
GET_ITEM(gobj)->xDD4_itemVar.lgun.x0 =
129+
40; // The item ID of itlgunbeam is 39, so might be related (ID of
130+
// itlgunray is 35 btw)
129131
Item_80268E5C(gobj, 3, ITEM_ANIM_UPDATE);
130132
}
131133

132134
bool it_8028E96C(Item_GObj* gobj)
133135
{
134136
Item* ip = GET_ITEM(gobj);
135-
--ip->xDD4_itemVar.lgun.x0;
137+
--ip->xDD4_itemVar.lgun.x0; // Decrementing this value maybe supports that
138+
// it refers to the item ID of itlgunbeam
136139
if (ip->xDD4_itemVar.lgun.x0 <= 0) {
137140
Item_80268E5C(gobj, 2, ITEM_ANIM_UPDATE);
138141
}

src/melee/it/items/itlgunray.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void it_80298168(HSD_GObj* owner_gobj, Vec3* pos, f32 facing_dir)
5151
ip->xDD4_itemVar.lgunray.angle =
5252
ip->facing_dir == +1 ? 0 : (float) M_PI;
5353
ip->xDD4_itemVar.lgunray.speed = item_spec_attr->speed;
54-
ip->xDD4_itemVar.lgunray.xC = spawn.pos;
54+
ip->xDD4_itemVar.lgunray.pos = spawn.pos;
5555
ip->x40_vel.x = item_spec_attr->speed * ip->facing_dir;
5656
db_80225DD8(gobj, owner_gobj);
5757
}
@@ -102,7 +102,7 @@ int it_80298300(HSD_GObj* gobj)
102102
void it_802985D8(HSD_GObj* gobj)
103103
{
104104
Item* ip = GET_ITEM(gobj);
105-
ip->xDD4_itemVar.lgunray.xC = ip->pos;
105+
ip->xDD4_itemVar.lgunray.pos = ip->pos;
106106
}
107107

108108
int it_802985F8(HSD_GObj* gobj)

0 commit comments

Comments
 (0)