Skip to content

Commit

Permalink
Merge branch 'doldecomp:master' into itlinkbow
Browse files Browse the repository at this point in the history
  • Loading branch information
thefoxcam authored Jul 7, 2024
2 parents beca9d7 + 2988ef9 commit d662d03
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"--max-errors",
type=int,
default=1,
help="the maximum number of errors allowed by the compiler (default 0, meaning unlimited)",
help="the maximum number of errors allowed by the compiler (0 meaning unlimited, default 1)",
)
parser.add_argument(
"--warn",
Expand Down
32 changes: 18 additions & 14 deletions src/melee/it/items/itcoin.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,27 @@ bool it_802F1604(Item_GObj* gobj)
return false;
}

void inline itCoin_ResetRotation(Item_GObj* gobj)
{
HSD_JObj* jobj;
jobj = GET_JOBJ(gobj);
HSD_JObjSetRotationX(jobj, 0.0F);
HSD_JObjSetRotationY(jobj, 0.0F);
HSD_JObjSetRotationZ(jobj, 0.0F);
}

void it_802F1630(Item_GObj* gobj)
{
Item* ip;
HSD_JObj* jobj;

PAD_STACK(16);

ip = GET_ITEM(gobj);
ip->x40_vel.z = 0.0F;
ip->x40_vel.y = 0.0F;
ip->x40_vel.x = 0.0F;
jobj = GET_JOBJ(gobj);

HSD_JObjSetRotationX(jobj, 0.0F);
HSD_JObjSetRotationY(jobj, 0.0F);
HSD_JObjSetRotationZ(jobj, 0.0F);
itCoin_ResetRotation(gobj);

Item_80268E5C(gobj, 1, ITEM_UNK_0x1);
it_802756D0(gobj);
Expand Down Expand Up @@ -192,6 +197,7 @@ bool it_802F1910(Item_GObj* gobj)
{
Item* ip;
itCoinAttributes* attr;
f32 zero = 0.0F;

PAD_STACK(20);

Expand All @@ -200,18 +206,18 @@ bool it_802F1910(Item_GObj* gobj)
it_802762BC(ip);
ip->xC9C = ip->xC9C + it_8027CBFC(gobj);
it_8027B798(gobj, &ip->x40_vel);
if ((ip->x40_vel.x == 0.0F) && (ip->x40_vel.y == 0.0F)) {
if ((ip->x40_vel.x == zero) && (ip->x40_vel.y == zero)) {
ip->x40_vel.x = 0.1F * -ip->xCCC_incDamageDirection;
ip->x40_vel.y = 0.1F;
}
lbVector_Normalize(&ip->x40_vel);
if ((ip->pos.x > 0.0F) && (-1 == ip->xCCC_incDamageDirection)) {
if ((ip->pos.x > zero) && (-1 == ip->xCCC_incDamageDirection)) {
ip->x40_vel.x *= -1;
}
if ((ip->pos.x < 0.0F) && (1 == ip->xCCC_incDamageDirection)) {
if ((ip->pos.x < zero) && (1 == ip->xCCC_incDamageDirection)) {
ip->x40_vel.x *= -1;
}
if (ip->pos.x > 0.0F) {
if (ip->pos.x > zero) {
if (ip->xCCC_incDamageDirection == -1) {
ip->x40_vel.x *= attr->x30 * (attr->x24 + ip->xC9C);
} else {
Expand All @@ -234,7 +240,7 @@ bool it_802F1910(Item_GObj* gobj)
if (ip->x40_vel.y >= attr->x40) {
ip->x40_vel.y = attr->x40;
}
ip->x40_vel.z = 0.0F;
ip->x40_vel.z = zero;
ip->xC9C = 0;
switch (ip->xDD4_itemVar.coin.x4) {
case 2:
Expand Down Expand Up @@ -274,11 +280,9 @@ bool it_802F1CB4(Item_GObj* gobj)
void it_802F1CE0(Item_GObj* gobj)
{
HSD_JObj* jobj = GET_JOBJ(gobj);
PAD_STACK(24);
PAD_STACK(16);

HSD_JObjSetRotationX(jobj, 0.0F);
HSD_JObjSetRotationY(jobj, 0.0F);
HSD_JObjSetRotationZ(jobj, 0.0F);
itCoin_ResetRotation(gobj);

Item_80268E5C(gobj, 4, ITEM_UNK_0x1);
}
Expand Down

0 comments on commit d662d03

Please sign in to comment.