mirror of
https://github.com/zeldaret/tmc
synced 2026-05-26 07:39:08 -04:00
Merge pull request #467 from EllipticEllipsis/pointers
This commit is contained in:
+1
-1
@@ -215,7 +215,7 @@ extern u32 sub_08079B24(void);
|
||||
extern void sub_08079BD8(Entity*);
|
||||
extern u32 sub_08079D48();
|
||||
extern void sub_08079D84(void);
|
||||
extern u32 sub_08079F8C(void);
|
||||
extern bool32 sub_08079F8C(void);
|
||||
extern u32 sub_08079FC4(u32);
|
||||
extern void sub_0807A050(void);
|
||||
extern void sub_0807A5B8(u32);
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ extern void sub_080787B4(Entity*);
|
||||
extern void sub_0808C650(Entity*, u32);
|
||||
extern u32 sub_0808C67C(void);
|
||||
extern void sub_0808C688(void);
|
||||
extern void sub_080A2BE4(Entity*, u32);
|
||||
extern void sub_080A2BE4(Entity*, bool32);
|
||||
|
||||
void CreateDust(Entity* parent);
|
||||
void CreateDustAt(s32, s32, u32);
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ void CollisionMain(void) {
|
||||
prio = gPriorityHandler.ent_priority;
|
||||
|
||||
// if any priority is set, dont do collision
|
||||
if (prio)
|
||||
if (prio != 0)
|
||||
return;
|
||||
|
||||
doCollision = &ram_CollideAll;
|
||||
|
||||
+16
-15
@@ -75,7 +75,7 @@ void AcroBandit_OnCollision(Entity* this) {
|
||||
if (this->type == 1) {
|
||||
if (this->action < 7 && this->knockbackDuration != 0) {
|
||||
brother = this->child;
|
||||
if (brother) {
|
||||
if (brother != NULL) {
|
||||
brother->parent = this->parent;
|
||||
do {
|
||||
brother->action = 5;
|
||||
@@ -84,10 +84,10 @@ void AcroBandit_OnCollision(Entity* this) {
|
||||
brother->iframes = -12;
|
||||
} while (brother = brother->child, brother != NULL);
|
||||
}
|
||||
if (this->parent) {
|
||||
if (this->parent != NULL) {
|
||||
this->parent->child = this->child;
|
||||
} else {
|
||||
if (this->child)
|
||||
if (this->child != NULL)
|
||||
this->parent = this;
|
||||
}
|
||||
|
||||
@@ -181,6 +181,7 @@ void AcroBandit_Type0Action1(Entity* this) {
|
||||
|
||||
void AcroBandit_Type0Action2(Entity* this) {
|
||||
static const u8 actionDelays[] = { 2, 2, 2, 3, 3, 3, 3, 4 };
|
||||
|
||||
GetNextFrame(this);
|
||||
if (this->frame & 1) {
|
||||
this->frame = 0;
|
||||
@@ -318,14 +319,14 @@ void AcroBandit_Type0Action8(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_08031E04(Entity* this) {
|
||||
bool32 sub_08031E04(Entity* this) {
|
||||
static const s8 gUnk_080CE5C0[] = { -32, 0, 0, 32, 32, 0, 0, 0 };
|
||||
Entity* ent;
|
||||
const s8* tmp;
|
||||
|
||||
ent = sub_08049DF4(1);
|
||||
if (ent == NULL)
|
||||
return 0;
|
||||
return FALSE;
|
||||
|
||||
tmp = &gUnk_080CE5C0[this->frame & 6];
|
||||
return EntityWithinDistance(this, ent->x.HALF.HI + tmp[0], ent->y.HALF.HI + tmp[1], 0x50);
|
||||
@@ -386,6 +387,7 @@ void AcroBandit_Type1Action1(Entity* this) {
|
||||
|
||||
void AcroBandit_Type1Action2(Entity* this) {
|
||||
static const u16 banditGravity[] = { 0x1600, 0x1300, 0x1000, 0xD00, 0xB00 };
|
||||
|
||||
GravityUpdate(this, banditGravity[this->type2]);
|
||||
if (this->type2 * -0xe <= this->z.HALF.HI) {
|
||||
this->action = 3;
|
||||
@@ -399,11 +401,11 @@ void AcroBandit_Type1Action2(Entity* this) {
|
||||
|
||||
void AcroBandit_Type1Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frame & ANIM_DONE) && (this->parent || --this->actionDelay == 0)) {
|
||||
if ((this->frame & ANIM_DONE) && ((this->parent != NULL) || (--this->actionDelay == 0))) {
|
||||
this->action = 4;
|
||||
this->direction = sub_08049F84(this, 1);
|
||||
*(u8*)&this->field_0x76 = 0;
|
||||
if (this->child) {
|
||||
if (this->child != NULL) {
|
||||
InitializeAnimation(this, 9);
|
||||
} else {
|
||||
InitializeAnimation(this, 8);
|
||||
@@ -414,9 +416,9 @@ void AcroBandit_Type1Action3(Entity* this) {
|
||||
void AcroBandit_Type1Action4(Entity* this) {
|
||||
Entity* parent;
|
||||
|
||||
if (sub_080322A4(this) == 0) {
|
||||
if (!sub_080322A4(this)) {
|
||||
parent = this->parent;
|
||||
if (parent == 0) {
|
||||
if (parent == NULL) {
|
||||
if (sub_08049FDC(this, 1)) {
|
||||
if ((++this->field_0x78.HALF.HI & 7) == 0) {
|
||||
sub_08004596(this, GetFacingDirection(this, gUnk_020000B0));
|
||||
@@ -538,30 +540,29 @@ void sub_08032290(Entity* this) {
|
||||
InitializeAnimation(this, 11);
|
||||
}
|
||||
|
||||
u32 sub_080322A4(Entity* this) {
|
||||
bool32 sub_080322A4(Entity* this) {
|
||||
if (this->child != NULL && (this->child->z.HALF.HI + 8) >= this->z.HALF.HI) {
|
||||
if (this->z.HALF.HI) {
|
||||
this->action = 5;
|
||||
this->z.HALF.HI = this->child->z.HALF.HI + 8;
|
||||
InitializeAnimation(this, 11);
|
||||
return 1;
|
||||
return TRUE;
|
||||
} else {
|
||||
sub_08032290(this);
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_080322E8(Entity* this) {
|
||||
u8 tmp;
|
||||
if (this->field_0x78.HALF.LO) {
|
||||
if (--this->field_0x78.HALF.LO == 0) {
|
||||
u32 flipX = this->spriteSettings.flipX;
|
||||
this->spriteSettings.flipX = flipX ^ 1;
|
||||
}
|
||||
} else {
|
||||
tmp = this->direction;
|
||||
u8 tmp = this->direction;
|
||||
if (tmp & 0xF) {
|
||||
tmp >>= 4;
|
||||
tmp ^= 1;
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ void Beetle_OnDeath(Entity* this) {
|
||||
GenericDeath(this);
|
||||
} else {
|
||||
Entity* ent = this->parent;
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->field_0xf--;
|
||||
this->parent = NULL;
|
||||
}
|
||||
|
||||
+1
-1
@@ -290,7 +290,7 @@ void sub_0802CBC4(Entity* this) {
|
||||
FreeCarryEntity(this);
|
||||
|
||||
ent = CreateObjectWithParent(this, OBJECT_20, 0, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->collisionLayer = this->collisionLayer;
|
||||
}
|
||||
}
|
||||
|
||||
+12
-13
@@ -92,7 +92,6 @@ void sub_0802A8FC(Entity* this) {
|
||||
}
|
||||
|
||||
void nullsub_143(Entity* this) {
|
||||
/* ... */
|
||||
}
|
||||
|
||||
void sub_0802A91C(Entity* this) {
|
||||
@@ -167,7 +166,7 @@ void sub_0802AA40(Entity* this) {
|
||||
this->actionDelay--;
|
||||
} else {
|
||||
Entity* ent = this->child;
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
if (ent->next == NULL) {
|
||||
this->child = NULL;
|
||||
} else {
|
||||
@@ -212,7 +211,7 @@ void sub_0802AAC0(Entity* this) {
|
||||
}
|
||||
}
|
||||
#else
|
||||
} else if (ent->actionDelay == 0 && ent->field_0xf < 0x51) {
|
||||
} else if ((ent->actionDelay == 0) && (ent->field_0xf <= 0x50)) {
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
}
|
||||
#endif
|
||||
@@ -304,7 +303,7 @@ void sub_0802AC40(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
LinearMoveUpdate(this);
|
||||
if (this->field_0x7a.HALF.LO) {
|
||||
if (sub_0802B234(this) == 0) {
|
||||
if (!sub_0802B234(this)) {
|
||||
this->field_0x7a.HALF.LO = 0;
|
||||
this->spritePriority.b1 = 0;
|
||||
#ifndef EU
|
||||
@@ -349,7 +348,7 @@ void sub_0802ACDC(Entity* this, u32 param_2) {
|
||||
|
||||
void sub_0802AD1C(Entity* this, u32 param_2) {
|
||||
Entity* ent = sub_08049DF4(1);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
u32 y = ent->y.HALF.HI - 0x18;
|
||||
u32 x = ent->x.HALF.HI;
|
||||
sub_08004596(this, sub_080045B4(this, x, y));
|
||||
@@ -416,7 +415,7 @@ void sub_0802AE24(Entity* this) {
|
||||
#ifdef EU
|
||||
void sub_0802AE68(Entity* this) {
|
||||
Entity* ent = this->parent;
|
||||
if (ent == 0) {
|
||||
if (ent == NULL) {
|
||||
this->action = 3;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->field_0x80.HALF.LO = 1;
|
||||
@@ -441,7 +440,7 @@ void sub_0802AE68(Entity* this) {
|
||||
#else
|
||||
void sub_0802AE68(Entity* this) {
|
||||
Entity* ent = sub_0802B250(this);
|
||||
if (ent == 0) {
|
||||
if (ent == NULL) {
|
||||
this->action = 3;
|
||||
this->field_0x80.HALF.LO = 1;
|
||||
sub_0802B264(this);
|
||||
@@ -559,7 +558,7 @@ void sub_0802B048(Entity* this) {
|
||||
}
|
||||
|
||||
ent = this->parent;
|
||||
if (ent && this->action == 1) {
|
||||
if ((ent != NULL) && this->action == 1) {
|
||||
this->spriteRendering.b3 = ent->spriteRendering.b3;
|
||||
this->spritePriority.b0 = ent->spritePriority.b0;
|
||||
this->spriteOrientation.flipY = ent->spriteOrientation.flipY;
|
||||
@@ -588,7 +587,7 @@ void sub_0802B048(Entity* this) {
|
||||
COLLISION_ON(this);
|
||||
this->field_0x7a.HALF.HI = 0;
|
||||
FreeCarryEntity(this);
|
||||
if (this->parent->next) {
|
||||
if (this->parent->next != NULL) {
|
||||
this->parent->field_0x80.HALF.HI = 0;
|
||||
}
|
||||
ent = CreateObjectWithParent(this, OBJECT_20, 0, 0);
|
||||
@@ -622,7 +621,7 @@ void sub_0802B1BC(Entity* this) {
|
||||
}
|
||||
|
||||
ent = this->parent;
|
||||
if (ent == 0) {
|
||||
if (ent == NULL) {
|
||||
this->action = 2;
|
||||
this->spriteSettings.draw = 1;
|
||||
}
|
||||
@@ -651,7 +650,7 @@ void sub_0802B1BC(Entity* this) {
|
||||
}
|
||||
|
||||
ent = sub_0802B250(this);
|
||||
if (ent == 0) {
|
||||
if (ent == NULL) {
|
||||
this->action = 2;
|
||||
sub_0802B264(this);
|
||||
} else {
|
||||
@@ -668,7 +667,7 @@ void sub_0802B1BC(Entity* this) {
|
||||
void sub_0802B204(Entity* this) {
|
||||
if (sub_080044EC(this, 0x2800) == 1) {
|
||||
Entity* ent = CreateEnemy(BOBOMB, 1);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
CopyPosition(this, ent);
|
||||
ent->parent = this->parent;
|
||||
}
|
||||
@@ -686,7 +685,7 @@ bool32 sub_0802B234(Entity* this) {
|
||||
#ifndef EU
|
||||
Entity* sub_0802B250(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
if (parent && parent->next == NULL) {
|
||||
if ((parent != NULL) && (parent->next == NULL)) {
|
||||
parent = NULL;
|
||||
}
|
||||
return parent;
|
||||
|
||||
@@ -44,7 +44,7 @@ void Bombarossa_OnCollision(BombarossaEntity* this) {
|
||||
switch (super->bitfield & 0x7f) {
|
||||
default:
|
||||
ent = CreateObject(OBJECT_20, 0, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
CopyPosition(super, ent);
|
||||
}
|
||||
DeleteThisEntity();
|
||||
|
||||
@@ -230,7 +230,7 @@ void sub_0803C400(BowMoblinEntity* this) {
|
||||
}
|
||||
|
||||
sub_0803C6DC(this);
|
||||
if (super->child) {
|
||||
if (super->child != NULL) {
|
||||
sub_0803C714(this);
|
||||
}
|
||||
}
|
||||
@@ -271,7 +271,7 @@ void sub_0803C4B0(BowMoblinEntity* this) {
|
||||
u32 sub_0803C568(BowMoblinEntity* this) {
|
||||
if (this->unk_0x81 == 0) {
|
||||
Entity* ent = sub_08049DF4(1);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
if (this->unk_0x82 == 2) {
|
||||
if (sub_0806FC80(super, ent, 0x30)) {
|
||||
return 1;
|
||||
|
||||
@@ -48,7 +48,7 @@ void BusinessScrubPrologue_OnCollision(BusinessScrubPrologueEntity* this) {
|
||||
super->flags &= ~ENT_COLLIDE;
|
||||
sub_08046030(this, 4);
|
||||
ent = CreateFx(super, FX_BUSH, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->z.HALF.HI -= 8;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ void sub_08045CE0(BusinessScrubPrologueEntity* this) {
|
||||
sub_0804604C(this);
|
||||
if (super->frame & 1) {
|
||||
ent = CreateProjectileWithParent(super, DEKU_SEED_PROJECTILE, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->parent = super;
|
||||
ent->direction = super->direction;
|
||||
super->frame &= 0xfe;
|
||||
@@ -186,7 +186,7 @@ void sub_08045E14(BusinessScrubPrologueEntity* this) {
|
||||
super->subAction = 0;
|
||||
sub_08046030(this, 0);
|
||||
ent = Create0x68FX(super, FX_STARS);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->spritePriority.b0 = 3;
|
||||
ent->z.HALF.HI -= 0xc;
|
||||
SetDefaultPriority(ent, PRIO_MESSAGE);
|
||||
@@ -299,7 +299,7 @@ void sub_08046078(BusinessScrubPrologueEntity* this) {
|
||||
for (index = 0; index <= 4; index++) {
|
||||
ent = CreateFx(super, FX_DEATH, 0x40);
|
||||
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->x.HALF.HI = gRoomControls.origin_x + *ptr;
|
||||
ptr++;
|
||||
ent->y.HALF.HI = gRoomControls.origin_y + *ptr;
|
||||
@@ -315,12 +315,12 @@ void sub_08046078(BusinessScrubPrologueEntity* this) {
|
||||
sub_0807BA8C(0x7a7, 1);
|
||||
|
||||
ent = CreateFx(super, FX_BIG_EXPLOSION2, 0x40);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
CopyPosition(super, ent);
|
||||
EnqueueSFX(SFX_184);
|
||||
}
|
||||
|
||||
if (super->child) {
|
||||
if (super->child != NULL) {
|
||||
super->child->action = 0xff;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -552,7 +552,7 @@ void sub_0801F884(Entity* this) {
|
||||
this->field_0xf--;
|
||||
} else {
|
||||
Entity* ent = Create0x68FX(this, FX_LIGHTNING_STRIKE);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->type2 = 64;
|
||||
this->action = 4;
|
||||
this->hitType = 165;
|
||||
|
||||
@@ -295,7 +295,7 @@ void sub_080391B4(CuccoAggrEntity* this) {
|
||||
if (this->unk_7a) {
|
||||
if ((this->unk_7b++ & 0x1f) == 0) {
|
||||
Entity* ent = CreateEnemy(CUCCO_AGGR, 2);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
u32 rand = (Random() & 0x17);
|
||||
const PosOffset* ptr = &gCuccoAggrSpawnPoints[rand];
|
||||
ent->x.HALF.HI = gRoomControls.scroll_x + ptr->x;
|
||||
@@ -321,7 +321,7 @@ void sub_08039218(CuccoAggrEntity* this) {
|
||||
void CuccoAggr_CreateFx(CuccoAggrEntity* this) {
|
||||
Entity* ent = CreateFx(super, gCuccoAggrFx[super->type], 0);
|
||||
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->x.HALF.HI += gCuccoAggrFxHorizontalOffsets[super->spriteSettings.flipX];
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -312,7 +312,7 @@ void sub_080210E4(Entity* this) {
|
||||
|
||||
this->frame &= ~1;
|
||||
ent = CreateProjectileWithParent(this, DARK_NUT_SWORD_SLASH, 2);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->parent = this;
|
||||
this->child = ent;
|
||||
}
|
||||
@@ -558,7 +558,7 @@ void sub_08021540(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08021588(Entity* this) {
|
||||
if (this->child) {
|
||||
if (this->child != NULL) {
|
||||
this->child->parent = NULL;
|
||||
this->child = NULL;
|
||||
}
|
||||
@@ -571,7 +571,7 @@ void sub_0802159C(Entity* this) {
|
||||
this->frame = 0;
|
||||
this->hitType = 0x51;
|
||||
ent = CreateProjectileWithParent(this, DARK_NUT_SWORD_SLASH, 3);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->parent = this;
|
||||
this->child = ent;
|
||||
}
|
||||
@@ -592,7 +592,7 @@ void sub_08021600(Entity* this) {
|
||||
this->frame = 0;
|
||||
this->hitType = 0x51;
|
||||
ent = CreateProjectileWithParent(this, DARK_NUT_SWORD_SLASH, 4);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->parent = this;
|
||||
this->child = ent;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ NONMATCH("asm/non_matching/fallingBoulder/sub_0802C334.inc", void sub_0802C334(E
|
||||
s32 i;
|
||||
for (i = 1; i > -1; i--) {
|
||||
Entity* ent = CreateFx(this, FX_ROCK2, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->x.HALF.HI += 12;
|
||||
ent->x.HALF.HI -= diff;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ void sub_08045454(Entity* this) {
|
||||
}
|
||||
|
||||
ent = CreateFx(this, FX_DEATH, 0);
|
||||
if (ent)
|
||||
if (ent != NULL)
|
||||
CopyPosition(this, ent);
|
||||
|
||||
DeleteEntity(this);
|
||||
|
||||
@@ -141,7 +141,7 @@ void sub_08039DD8(FlyingSkullEntity* this) {
|
||||
super->actionDelay = 0x1e;
|
||||
} else {
|
||||
ent = CreateEnemy(STALFOS, super->type - 2);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->type2 = 1;
|
||||
CopyPosition(super, ent);
|
||||
SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
|
||||
|
||||
+5
-5
@@ -283,7 +283,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D3B8.inc", void sub_0802D3B8(GleerokE
|
||||
do {
|
||||
ent = CreateEnemy(GLEEROK, 1);
|
||||
super->child = ent;
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->type2 = uvar1 + 1;
|
||||
super->child->collisionLayer = super->collisionLayer;
|
||||
super->child->x.HALF.HI = super->x.HALF.HI;
|
||||
@@ -301,7 +301,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D3B8.inc", void sub_0802D3B8(GleerokE
|
||||
|
||||
ent = CreateEnemy(GLEEROK, 2);
|
||||
super->child = ent;
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
super->child->collisionLayer = super->collisionLayer;
|
||||
super->child->x.HALF.HI = super->x.HALF.HI;
|
||||
super->child->y.HALF.HI = super->y.HALF.HI + ((uvar1 + 1) * 12);
|
||||
@@ -760,7 +760,7 @@ void sub_0802DCE0(GleerokEntity* this) {
|
||||
if (this->unk_84->ent2->field_0xf == 0) {
|
||||
super->child = CreateProjectileWithParent(super, GLEEROK_PROJECTILE, 0);
|
||||
|
||||
if (super->child) {
|
||||
if (super->child != NULL) {
|
||||
super->child->direction = this->unk_84->filler[0x15];
|
||||
super->child->type2 = this->unk_84->ent2->frame & 0xf;
|
||||
super->child->parent = this->unk_84->ent2;
|
||||
@@ -827,7 +827,7 @@ void sub_0802DDD8(GleerokEntity* this) {
|
||||
|
||||
if (this->unk_84->ent2->field_0xf == 1) {
|
||||
super->child = CreateProjectileWithParent(super, GLEEROK_PROJECTILE, r2);
|
||||
if (super->child) {
|
||||
if (super->child != NULL) {
|
||||
super->child->direction = this->unk_84->filler[0x15];
|
||||
super->child->type2 = this->unk_84->ent2->frame & 0xf;
|
||||
super->child->parent = this->unk_84->ent2;
|
||||
@@ -1094,7 +1094,7 @@ void sub_0802E300(GleerokEntity* this) {
|
||||
InitializeAnimation(super, 0x4d);
|
||||
ent = CreateEnemy(GLEEROK, 5);
|
||||
super->child = ent;
|
||||
if (super->child) {
|
||||
if (super->child != NULL) {
|
||||
super->child->parent = super;
|
||||
heap->ent = super->child;
|
||||
((GleerokEntity*)super->child)->unk_84 = heap;
|
||||
|
||||
@@ -98,7 +98,7 @@ void sub_0802BCA8(Entity* this) {
|
||||
this->field_0x3a = this->field_0x3a & 0xfb;
|
||||
this->field_0x1c = 0x12;
|
||||
ent = CreateEnemy(HELMASAUR, 1);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->animationState = this->animationState;
|
||||
CopyPosition(this, ent);
|
||||
}
|
||||
@@ -356,7 +356,7 @@ void sub_0802C18C(Entity* this) {
|
||||
this->field_0x78.HALF.LO--;
|
||||
if ((this->field_0x78.HALF.LO & 7) == 0) {
|
||||
Entity* ent = CreateObject(SPECIAL_FX, 0x11, 0x40);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
PositionRelative(this, ent, 0, Q_16_16(1.0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ void sub_08034E68(Entity* this) {
|
||||
sub_08035120(this);
|
||||
}
|
||||
if (gRoomTransition.field_0x39 == 0) {
|
||||
if (sub_08079F8C() != 0) {
|
||||
if (sub_08079F8C()) {
|
||||
this->action = 3;
|
||||
scriptExecutionContext = StartCutscene(this, (u16*)script_MazaalMacroDefeated);
|
||||
*(ScriptExecutionContext**)&this->cutsceneBeh = scriptExecutionContext;
|
||||
|
||||
@@ -34,7 +34,7 @@ void MiniSlime_OnCollision(Entity* this) {
|
||||
|
||||
void MiniSlime_OnDeath(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
if (this != parent && parent) {
|
||||
if ((this != parent) && (parent != NULL)) {
|
||||
this->field_0x6c.HALF.LO &= 0x7f;
|
||||
this->parent->child = this->child;
|
||||
this->child->parent = this->parent;
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ void sub_08022D40(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08022D90(Entity* this) {
|
||||
if (this->parent->next) {
|
||||
if (this->parent->next != NULL) {
|
||||
Entity* parent;
|
||||
|
||||
gUnk_080CBBBC[this->action](this);
|
||||
|
||||
@@ -42,7 +42,7 @@ NONMATCH("asm/non_matching/moldworm/Moldworm.inc", void Moldworm(Entity* this))
|
||||
this->field_0x7c.BYTES.byte1 = this->field_0x7c.BYTES.byte0;
|
||||
EnemyFunctionHandler(this, Moldworm_Functions);
|
||||
} else {
|
||||
if (this->parent->next) {
|
||||
if (this->parent->next != NULL) {
|
||||
if (this->type != 8) {
|
||||
sub_080235BC(this);
|
||||
} else {
|
||||
@@ -191,7 +191,7 @@ void sub_08023AB0(Entity*);
|
||||
void sub_08023398(Entity* this) {
|
||||
this->field_0x7c.BYTES.byte0++;
|
||||
|
||||
if (this->field_0x7c.BYTES.byte3 && sub_08049FDC(this, 1) == 0) {
|
||||
if (this->field_0x7c.BYTES.byte3 && !sub_08049FDC(this, 1)) {
|
||||
this->field_0x78.HWORD = 1;
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ void sub_080234D8(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0802351C(Entity* this) {
|
||||
if (this->actionDelay != 0 && (this->type2 == 1 || gPlayerEntity.frameIndex == 0xff)) {
|
||||
if ((this->actionDelay != 0) && ((this->type2 == 1) || (gPlayerEntity.frameIndex == 0xff))) {
|
||||
this->actionDelay = 0;
|
||||
this->child->action = 3;
|
||||
this->child->field_0xf = this->field_0x80.HALF.LO;
|
||||
@@ -377,8 +377,8 @@ void sub_0802376C(Entity* this) {
|
||||
void sub_080237D8(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
|
||||
if (parent->animIndex == 0x17 && this->actionDelay != 0 && this->x.HALF.HI == parent->x.HALF.HI &&
|
||||
this->y.HALF.HI == parent->y.HALF.HI) {
|
||||
if ((parent->animIndex == 0x17) && (this->actionDelay != 0) && (this->x.HALF.HI == parent->x.HALF.HI) &&
|
||||
(this->y.HALF.HI == parent->y.HALF.HI)) {
|
||||
this->action = 1;
|
||||
COLLISION_OFF(this);
|
||||
this->spriteSettings.draw = 0;
|
||||
@@ -501,7 +501,7 @@ void sub_08023AB0(Entity* this) {
|
||||
if (this->field_0x7a.HALF.HI == 8) {
|
||||
if (this->field_0x7c.BYTES.byte2) {
|
||||
this->field_0x7c.BYTES.byte2--;
|
||||
} else if (!sub_08023B38(this) || 0x1d >= this->field_0x78.HWORD) {
|
||||
} else if (!sub_08023B38(this) || (this->field_0x78.HWORD <= 0x1D)) {
|
||||
this->hitType = 0x85;
|
||||
this->field_0x7a.HALF.HI = 0;
|
||||
this->field_0x7c.BYTES.byte2 = 30;
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ void Octorok_ShootNut(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frame & 1) {
|
||||
Entity* ent = CreateProjectileWithParent(this, ROCK_PROJECTILE, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
const s8* off;
|
||||
ent->direction = this->direction;
|
||||
off = &gOctorokNutOffset[this->direction / 4];
|
||||
|
||||
@@ -495,7 +495,7 @@ void OctorokBoss_Action1(OctorokBossEntity* this) {
|
||||
sub_08036914(super, angle, radius);
|
||||
this->angle.HALF.HI = -((OctorokBossEntity*)super->parent)->angle.HALF.HI;
|
||||
}
|
||||
if (IS_FROZEN((OctorokBossEntity*)super->parent) == 0) {
|
||||
if (!IS_FROZEN((OctorokBossEntity*)super->parent)) {
|
||||
super->spriteSettings.draw |= 1;
|
||||
}
|
||||
break;
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ void Peahat_OnCollision(Entity* this) {
|
||||
if (this->field_0x82.HALF.LO) {
|
||||
if (this->bitfield == 0x94) {
|
||||
Entity* ent = CreateEnemy(PEAHAT, PeahatForm_Propeller);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
CopyPosition(this, ent);
|
||||
ent->z.HALF.HI -= 8;
|
||||
}
|
||||
|
||||
+5
-5
@@ -171,7 +171,7 @@ void sub_080240B8(Entity* this) {
|
||||
|
||||
this->field_0x82.HALF.HI = 0;
|
||||
ent = CreateProjectileWithParent(this, DIRT_BALL_PROJECTILE, this->field_0x82.HALF.HI);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
this->child = ent;
|
||||
ent->parent = this;
|
||||
ent->y.HALF.HI += 0x10;
|
||||
@@ -414,7 +414,7 @@ void sub_080244E8(Entity* this) {
|
||||
this->field_0x78.HWORD -= 0xe;
|
||||
|
||||
ent = CreateProjectileWithParent(this, DIRT_BALL_PROJECTILE, this->field_0x82.HALF.HI);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->parent = this;
|
||||
ent->z.HALF.HI += 0xe;
|
||||
ent->child = this->child;
|
||||
@@ -437,7 +437,7 @@ void sub_080244E8(Entity* this) {
|
||||
this->field_0x78.HWORD -= 0xe;
|
||||
|
||||
ent = CreateProjectileWithParent(this, DIRT_BALL_PROJECTILE, this->field_0x82.HALF.HI);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->parent = this;
|
||||
ent->z.HALF.HI += 0xe;
|
||||
this->child = ent;
|
||||
@@ -662,7 +662,7 @@ bool32 sub_08024B38(Entity* this) {
|
||||
}
|
||||
|
||||
ent = FindEntityByID(PLAYER_ITEM, PLAYER_ITEM_BOMB, 2);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
do {
|
||||
if (ent->action != 2 && ent->z.HALF.HI == 0 && sub_08049F1C(this, ent, 0xa0)) {
|
||||
iVar4 = 1;
|
||||
@@ -679,7 +679,7 @@ bool32 sub_08024B38(Entity* this) {
|
||||
}
|
||||
|
||||
ent = FindEntityByID(OBJECT, POT, 6);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
do {
|
||||
if (ent->action == 1 && sub_08049F1C(this, ent, 0xa0)) {
|
||||
iVar4 = 1;
|
||||
|
||||
@@ -529,12 +529,12 @@ void sub_08025AE8(Entity* this) {
|
||||
Entity* ent;
|
||||
|
||||
ent = CreateFx(this, FX_BROWN_SMOKE, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->y.WORD--;
|
||||
}
|
||||
|
||||
ent = CreateFx(this, FX_BROWN_SMOKE_LARGE, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->y.WORD++;
|
||||
}
|
||||
}
|
||||
@@ -553,7 +553,7 @@ void sub_08025B18(Entity* this) {
|
||||
sub_08025AB8((((x + offset[0]) >> 4) & 0x3fU) | ((((y + offset[1]) >> 4) & 0x3fU) << 6), layer);
|
||||
|
||||
ent = CreateObject(OBJECT_21, 2, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
PositionRelative(this, ent, Q_16_16(offset[0]), Q_16_16(offset[1]));
|
||||
ent->x.HALF.HI &= -0x10;
|
||||
ent->x.HALF.HI += 8;
|
||||
@@ -567,7 +567,7 @@ void sub_08025B18(Entity* this) {
|
||||
void sub_08025BD4(Entity* this) {
|
||||
if (this->field_0x82.HALF.LO && (this->frame & 1) == 0) {
|
||||
Entity* ent = CreateObject(OBJECT_21, 0, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
PositionRelative(this, ent, Q_16_16(gUnk_080CC0BA[this->animationState * 2 + 0]),
|
||||
Q_16_16(gUnk_080CC0BA[this->animationState * 2 + 1]));
|
||||
ent->z.HALF.HI = -10;
|
||||
|
||||
@@ -45,7 +45,7 @@ void RockChuchu_OnCollision(Entity* this) {
|
||||
case 0x1c:
|
||||
CreateFx(this, FX_ROCK, 0);
|
||||
ent = CreateEnemy(CHUCHU, 1);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->type2 = 1;
|
||||
#ifndef EU
|
||||
ent->iframes = -8;
|
||||
@@ -100,7 +100,7 @@ void sub_080223E4(Entity* this) {
|
||||
Entity* ent;
|
||||
|
||||
ent = this->child;
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->bitfield = 0x94;
|
||||
ent->iframes = 0x10;
|
||||
#ifndef EU
|
||||
|
||||
@@ -64,7 +64,7 @@ void ScissorsBeetle_OnGrabbed(ScissorsBeetleEntity* this) {
|
||||
|
||||
void ScissorsBeetle_Init(ScissorsBeetleEntity* this) {
|
||||
Entity* ent = CreateProjectile(MANDIBLES_PROJECTILE);
|
||||
if (!ent)
|
||||
if (ent == NULL)
|
||||
return;
|
||||
|
||||
sub_0804A720(super);
|
||||
|
||||
+1
-1
@@ -114,7 +114,7 @@ void sub_080450A8(Entity* this) {
|
||||
}
|
||||
|
||||
ent = CreateFx(this, FX_DEATH, 0);
|
||||
if (ent)
|
||||
if (ent != NULL)
|
||||
CopyPosition(this, ent);
|
||||
|
||||
DeleteEntity(this);
|
||||
|
||||
@@ -132,7 +132,7 @@ void sub_08023CE0(Entity* this) {
|
||||
if (this->frame) {
|
||||
if (this->frame & ANIM_DONE) {
|
||||
Entity* ent = CreateEnemy(SLUGGULA, 1);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
sub_0804A4E4(this, ent);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -163,7 +163,7 @@ void sub_08023E54(Entity* this) {
|
||||
if (this->field_0xf++ > 27) {
|
||||
this->field_0xf = 0;
|
||||
ent = CreateEnemy(SLUGGULA, 2);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
const s8* ptr = &gUnk_080CBDF7[this->animationState * 2];
|
||||
PositionRelative(this, ent, Q_16_16(ptr[0]), Q_16_16(ptr[1]));
|
||||
}
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@ void Spark_OnCollision(Entity* this) {
|
||||
this->spriteSettings.draw = 0;
|
||||
this->action = 2;
|
||||
ent = CreateFx(this, FX_DEATH, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
this->child = ent;
|
||||
this->actionDelay = 14;
|
||||
CopyPosition(this, ent);
|
||||
@@ -122,7 +122,7 @@ void sub_0802B35C(Entity* this) {
|
||||
void sub_0802B4A8(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
Entity* ent = CreateObjectWithParent(this, GROUND_ITEM, 0x60, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->y.HALF.HI -= 4;
|
||||
}
|
||||
DeleteEntity(this);
|
||||
|
||||
@@ -380,7 +380,7 @@ bool32 sub_080288A4(Entity* this) {
|
||||
|
||||
void sub_080288C0(Entity* this) {
|
||||
Entity* ent = this->child;
|
||||
if (ent && (ent->bitfield & 0x80)) {
|
||||
if ((ent != NULL) && (ent->bitfield & 0x80)) {
|
||||
this->knockbackDirection = ent->knockbackDirection;
|
||||
this->iframes = -ent->iframes;
|
||||
this->knockbackSpeed = ent->knockbackSpeed;
|
||||
|
||||
+2
-2
@@ -132,7 +132,7 @@ void sub_0803BD08(TakkuriEntity* this) {
|
||||
sub_0803BEE8(this);
|
||||
GetNextFrame(super);
|
||||
ent = sub_08049DF4(1);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
if (EntityInRectRadius(super, gUnk_020000B0, 0x88, 0x50)) {
|
||||
if (gUnk_020000B0->y.HALF.HI > super->y.HALF.HI + 8) {
|
||||
super->action = 2;
|
||||
@@ -306,7 +306,7 @@ void sub_0803C0AC(Entity* this) {
|
||||
u32 index, rupeeType, rupees;
|
||||
Entity* ent;
|
||||
ent = sub_08049DF4(1);
|
||||
if (!ent)
|
||||
if (ent == NULL)
|
||||
return;
|
||||
|
||||
rupees = gSave.stats.rupees;
|
||||
|
||||
@@ -561,7 +561,7 @@ void VaatiWrathType0ActionD(Entity* this) {
|
||||
void sub_08041BE8(Entity* this) {
|
||||
Entity* entity;
|
||||
|
||||
if (sub_08079F8C() != 0) {
|
||||
if (sub_08079F8C()) {
|
||||
this->subAction = 1;
|
||||
this->actionDelay = 120;
|
||||
this->updatePriority = PRIO_NO_BLOCK;
|
||||
|
||||
@@ -34,7 +34,7 @@ void sub_0802A250(Entity* this) {
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
|
||||
ent = CreateObject(OBJECT_66, 0, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->parent = this;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -339,7 +339,7 @@ void DeleteEntityAny(Entity* ent) {
|
||||
}
|
||||
|
||||
void DeleteEntity(Entity* ent) {
|
||||
if (ent->next) {
|
||||
if (ent->next != NULL) {
|
||||
UnloadGFXSlots(ent);
|
||||
UnloadOBJPalette(ent);
|
||||
UnloadOBJPalette2(ent);
|
||||
@@ -418,7 +418,7 @@ Manager* GetEmptyManager(void) {
|
||||
|
||||
void DeleteManager(void* ent) {
|
||||
Manager* manager = (Manager*)ent;
|
||||
if (!manager->next)
|
||||
if (manager->next == NULL)
|
||||
return;
|
||||
|
||||
ReleaseTransitionManager(manager);
|
||||
|
||||
+23
-14
@@ -62,8 +62,9 @@ void ManagerB_WaitForFlag(ManagerB* this) {
|
||||
|
||||
void ManagerB_WaitForDone(ManagerB* this) {
|
||||
// check if all helpers are done
|
||||
if (this->manager.unk_0e)
|
||||
if (this->manager.unk_0e) {
|
||||
return;
|
||||
}
|
||||
// set the completion flag for the fight
|
||||
SetFlag(this->unk_3e);
|
||||
// restore music (if it was set, which apparently is only possible if there's a flag the fight waited for)
|
||||
@@ -87,25 +88,28 @@ void ManagerB_LoadFight(Manager* this) {
|
||||
EntityData* prop;
|
||||
Entity* ent;
|
||||
u32 counter;
|
||||
|
||||
this->action = 2;
|
||||
this->unk_0e = 0;
|
||||
counter = 0;
|
||||
// Create a helper to keep track of the created entities.
|
||||
monitor = CreateHelper(this);
|
||||
if (!monitor)
|
||||
if (monitor == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
prop = (EntityData*)GetCurrentRoomProperty(this->unk_0b);
|
||||
if (prop) {
|
||||
while (*((u8*)prop) != 0xFF) {
|
||||
if (prop != NULL) {
|
||||
while (prop->kind != 0xFF) {
|
||||
ent = LoadRoomEntity(prop++);
|
||||
if (ent && (ent->kind == ENEMY)) {
|
||||
if ((ent != NULL) && (ent->kind == ENEMY)) {
|
||||
ent->field_0x6c.HALF.HI |= 0x40;
|
||||
ManagerBHelper_Monitor(monitor, ent, counter++);
|
||||
}
|
||||
if (counter >= 7) {
|
||||
counter = 0;
|
||||
monitor = CreateHelper(this);
|
||||
if (!monitor)
|
||||
if (monitor == NULL)
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -139,27 +143,31 @@ void ManagerBHelper_Monitor(ManagerBHelper* this, Entity* ent, u32 index) {
|
||||
// case volumeMasterTarget is 1: The manager is a helper
|
||||
|
||||
void ManagerBHelper_Main(Manager* this) {
|
||||
u8 i, anyRemaining;
|
||||
u8 i;
|
||||
bool32 anyRemaining;
|
||||
Entity* current;
|
||||
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
SetDefaultPriority((Entity*)this, PRIO_NO_BLOCK);
|
||||
}
|
||||
// go through and check all monitored enemies.
|
||||
anyRemaining = 0;
|
||||
anyRemaining = FALSE;
|
||||
for (i = 0; i < 8; i++) {
|
||||
if ((current = ((ManagerBHelper*)this)->enemies[i])) {
|
||||
if (!current->next) {
|
||||
current = ((ManagerBHelper*)this)->enemies[i];
|
||||
if (current != NULL) {
|
||||
if (current->next == NULL) {
|
||||
((ManagerBHelper*)this)->enemies[i] = 0;
|
||||
} else {
|
||||
anyRemaining = 1;
|
||||
anyRemaining = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!anyRemaining) {
|
||||
// inform the parent that we're done
|
||||
if (((ManagerB*)this->parent)->manager.unk_0e) {
|
||||
((ManagerB*)this->parent)->manager.unk_0e--;
|
||||
ManagerB* parent = (ManagerB*)this->parent;
|
||||
if (parent->manager.unk_0e != 0) {
|
||||
parent->manager.unk_0e--;
|
||||
}
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -174,8 +182,9 @@ void ReplaceMonitoredEntity(Entity* old, Entity* new) {
|
||||
u32 i;
|
||||
for (current = (ManagerBHelper*)end->next; (Manager*)current != end;
|
||||
current = (ManagerBHelper*)current->manager.next) {
|
||||
if (current->manager.type != 0x9 || current->manager.subtype != 0xB)
|
||||
if (current->manager.type != 0x9 || current->manager.subtype != 0xB) {
|
||||
continue;
|
||||
}
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (old == current->enemies[i]) {
|
||||
current->enemies[i] = new;
|
||||
|
||||
@@ -127,7 +127,7 @@ void sub_080675D4(Entity* this) {
|
||||
|
||||
for (i = 0; i < 9; i++, gUnk++) {
|
||||
Entity* ent = CreateFx(this, FX_DEATH, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->x.HALF.HI += gUnk->x;
|
||||
ent->y.HALF.HI += gUnk->y;
|
||||
ent->z.HALF.HI = subAction;
|
||||
@@ -140,7 +140,7 @@ void sub_080675D4(Entity* this) {
|
||||
gUnk = gUnk_08110E8A;
|
||||
for (i = 0; i < 4; i++, gUnk++) {
|
||||
Entity* ent = CreateFx(this, FX_ROCK, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->x.HALF.HI = gUnk->x + ent->x.HALF.HI;
|
||||
ent->y.HALF.HI = gUnk->y + ent->y.HALF.HI;
|
||||
ent->z.HALF.HI = subAction;
|
||||
|
||||
@@ -117,7 +117,7 @@ void sub_08064EE8(Entity* this) {
|
||||
}
|
||||
|
||||
fxEnt = CreateFx(this, confettiFx, 0);
|
||||
if (fxEnt && bVar1 == 2) {
|
||||
if ((fxEnt != NULL) && (bVar1 == 2)) {
|
||||
fxEnt->spriteSettings.flipX = 1;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -138,7 +138,7 @@ u32 sub_0806EE20(Entity* ent) {
|
||||
u32 v3;
|
||||
|
||||
if (!ent->interactType) {
|
||||
if (ent->child)
|
||||
if (ent->child != NULL)
|
||||
return gUnk_08114EFC[ent->field_0x16](ent);
|
||||
} else {
|
||||
ent->knockbackSpeed = 8;
|
||||
|
||||
@@ -22,7 +22,7 @@ void sub_0809CC74(Entity* this) {
|
||||
/* Create steam clouds */
|
||||
for (i = 0; i < 3; i++) {
|
||||
ent = CreateObject(BAKER_OVEN, 1, i);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->parent = this;
|
||||
PositionRelative(this, ent, 16 * Q_16_16((i + 1) / 2) - Q_16_16(8.0), Q_16_16(-14.0));
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ void sub_08088BE0(BigBarrelEntity* this) {
|
||||
if (CheckLocalFlag(0x15) == 0) {
|
||||
sub_08088C78(this, 2, 0, 0xffffff88);
|
||||
ent = sub_08088C78(this, 4, 0x15, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->x.HALF.HI = gRoomControls.origin_x + 0x48;
|
||||
ent->y.HALF.HI = gRoomControls.origin_y + 200;
|
||||
}
|
||||
@@ -114,7 +114,7 @@ void sub_08088BE0(BigBarrelEntity* this) {
|
||||
if (CheckLocalFlag(0x16) == 0) {
|
||||
sub_08088C78(this, 2, 1, 0x78);
|
||||
ent = sub_08088C78(this, 4, 0x16, 0);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->x.HALF.HI = gRoomControls.origin_x + 0x188;
|
||||
ent->y.HALF.HI = gRoomControls.origin_y + 200;
|
||||
}
|
||||
@@ -249,7 +249,7 @@ void sub_08088E74(BigBarrelEntity* this) {
|
||||
} else {
|
||||
if ((gRoomTransition.frameCount & 7U) == 0) {
|
||||
ent = CreateObjectWithParent(super, OBJECT_2A, 0, 0x1e);
|
||||
if (ent) {
|
||||
if (ent != NULL) {
|
||||
ent->updatePriority = 3;
|
||||
ent->spriteRendering.b3 = 0;
|
||||
ent->spritePriority.b0 = 0;
|
||||
|
||||
+21
-25
@@ -15,11 +15,9 @@ void Book(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0809B3C4(Entity* this) {
|
||||
u32 obtained;
|
||||
|
||||
obtained = GetInventoryValue(this->type + ITEM_QST_BOOK1);
|
||||
u32 obtained = GetInventoryValue(this->type + ITEM_QST_BOOK1);
|
||||
if (this->type2 != 3) {
|
||||
if (obtained) {
|
||||
if (obtained != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
} else {
|
||||
@@ -42,7 +40,7 @@ void sub_0809B3C4(Entity* this) {
|
||||
}
|
||||
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
InitAnimationForceUpdate(this, this->type + 0x39);
|
||||
InitAnimationForceUpdate(this, this->type + ITEM_QST_BOOK1);
|
||||
|
||||
switch (this->type2) {
|
||||
case 0:
|
||||
@@ -55,22 +53,23 @@ void sub_0809B3C4(Entity* this) {
|
||||
case 1: {
|
||||
u32 scroll;
|
||||
u32 height;
|
||||
|
||||
this->action = 3;
|
||||
scroll = (u16)gRoomControls.scroll_y - 0x10;
|
||||
height = (u16)this->y.HALF.HI - scroll;
|
||||
this->z.HALF.HI -= height;
|
||||
return;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
this->action = 4;
|
||||
return;
|
||||
break;
|
||||
case 3:
|
||||
this->action = 5;
|
||||
this->subAction = 0;
|
||||
this->spritePriority.b0 = 3;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,10 +88,10 @@ void sub_0809B4A8(Entity* this) {
|
||||
|
||||
this->action = 2;
|
||||
this->actionDelay = 30;
|
||||
this->speed = 64;
|
||||
this->direction = 16;
|
||||
this->speed = 0x40;
|
||||
this->direction = 0x10;
|
||||
|
||||
gPlayerState.pushedObject = 0x9e;
|
||||
gPlayerState.pushedObject = TREE_THORNS;
|
||||
gPlayerState.queued_action = PLAYER_PUSH;
|
||||
gPlayerState.flags |= PL_BUSY;
|
||||
|
||||
@@ -101,7 +100,7 @@ void sub_0809B4A8(Entity* this) {
|
||||
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
|
||||
EnqueueSFX(SFX_10F);
|
||||
} else {
|
||||
this->actionDelay = 0x16;
|
||||
this->actionDelay = 22;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,12 +108,12 @@ void sub_0809B524(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
if (--this->field_0xf == 0) {
|
||||
this->action = 3;
|
||||
this->y.HALF.HI += 32;
|
||||
this->z.HALF.HI -= 32;
|
||||
this->y.HALF.HI += 0x20;
|
||||
this->z.HALF.HI -= 0x20;
|
||||
} else {
|
||||
this->action = 1;
|
||||
this->actionDelay = 22;
|
||||
this->field_0x80.HALF.LO = 24;
|
||||
this->field_0x80.HALF.LO = 0x18;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +133,7 @@ void sub_0809B56C(Entity* this) {
|
||||
SetFlag(this->field_0x86.HWORD);
|
||||
|
||||
fx = CreateFx(this, FX_DEATH, 0);
|
||||
if (fx) {
|
||||
if (fx != NULL) {
|
||||
SortEntityAbove(this, fx);
|
||||
}
|
||||
}
|
||||
@@ -143,7 +142,7 @@ void sub_0809B5B4(Entity* this) {
|
||||
if (gPlayerState.flags & PL_MINISH) {
|
||||
sub_0800445C(this);
|
||||
} else if (IsCollidingPlayer(this)) {
|
||||
CreateItemEntity(this->type + 0x39, 0, 0);
|
||||
CreateItemEntity(this->type + ITEM_QST_BOOK1, 0, 0);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
@@ -152,9 +151,8 @@ void sub_0809B5EC(Entity* this) {
|
||||
if (this->spriteSettings.draw == 1) {
|
||||
switch (this->subAction) {
|
||||
case 0: {
|
||||
Entity* parent;
|
||||
parent = FindEntityByID(NPC, STURGEON, 7);
|
||||
if (!parent) {
|
||||
Entity* parent = FindEntityByID(NPC, STURGEON, 7);
|
||||
if (parent == NULL) {
|
||||
return;
|
||||
}
|
||||
if (parent->x.HALF.HI < this->x.HALF.HI) {
|
||||
@@ -170,7 +168,7 @@ void sub_0809B5EC(Entity* this) {
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
if (!this->parent || !this->parent->next) {
|
||||
if ((this->parent == NULL) || (this->parent->next == NULL)) {
|
||||
DeleteThisEntity();
|
||||
return;
|
||||
}
|
||||
@@ -206,9 +204,8 @@ void sub_0809B5EC(Entity* this) {
|
||||
}
|
||||
|
||||
u32 sub_0809B688(Entity* this) {
|
||||
u32 ret;
|
||||
u32 ret = EntityInRectRadius(this, &gPlayerEntity, 6, 12);
|
||||
|
||||
ret = EntityInRectRadius(this, &gPlayerEntity, 6, 12);
|
||||
if (ret == 1 && gPlayerState.field_0xd != 16) {
|
||||
ret = 0;
|
||||
}
|
||||
@@ -217,8 +214,7 @@ u32 sub_0809B688(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0809B6B0(Entity* parent, Entity* this) {
|
||||
s32 offset;
|
||||
offset = (s32)gUnk_08123D94[parent->animationState >> 1] << 16;
|
||||
s32 offset = (s32)gUnk_08123D94[parent->animationState >> 1] << 16;
|
||||
|
||||
PositionRelative(parent, this, 0, offset);
|
||||
|
||||
|
||||
+1
-1
@@ -242,7 +242,7 @@ u32 sub_08081F7C(Entity* this, u32 r7) {
|
||||
if (this->actionDelay == 0)
|
||||
return 1;
|
||||
if (--this->actionDelay > 6) {
|
||||
if (this->child)
|
||||
if (this->child != NULL)
|
||||
this->child->spriteOffsetY = -4;
|
||||
} else {
|
||||
if (this->actionDelay == 6) {
|
||||
|
||||
@@ -252,7 +252,7 @@ void sub_0808EABC(Entity* this) {
|
||||
|
||||
void sub_0808EB74(Entity* this) {
|
||||
Entity* entity = sub_0808EC80(gMapDataBottomSpecial.unk6);
|
||||
if (entity) {
|
||||
if (entity != NULL) {
|
||||
this->x.WORD = entity->x.WORD;
|
||||
this->y.WORD = entity->y.WORD;
|
||||
this->spriteRendering.b3 = entity->spriteRendering.b3;
|
||||
@@ -305,7 +305,7 @@ void sub_0808EBB8(Entity* this) {
|
||||
// Fall through
|
||||
default:
|
||||
entity = sub_0808EC80(var0);
|
||||
if (entity) {
|
||||
if (entity != NULL) {
|
||||
SortEntityBelow(entity, this);
|
||||
this->spriteRendering.b3 = entity->spriteRendering.b3;
|
||||
x = entity->x.HALF.HI;
|
||||
|
||||
@@ -33,12 +33,11 @@ void sub_080860D8(FloatingPlatformEntity* this) {
|
||||
}
|
||||
|
||||
void sub_0808611C(FloatingPlatformEntity* this) {
|
||||
int iVar2;
|
||||
bool32 iVar2 = sub_08086168(this);
|
||||
|
||||
iVar2 = sub_08086168(this);
|
||||
if (super->actionDelay != 0 && super->parent->actionDelay == 0) {
|
||||
|
||||
if (iVar2 != 0) {
|
||||
if (iVar2) {
|
||||
super->parent->actionDelay++;
|
||||
}
|
||||
|
||||
@@ -46,7 +45,7 @@ void sub_0808611C(FloatingPlatformEntity* this) {
|
||||
} else if (super->actionDelay == 0) {
|
||||
sub_080A2BE4(super, iVar2);
|
||||
} else {
|
||||
sub_080A2BE4(super, 0);
|
||||
sub_080A2BE4(super, FALSE);
|
||||
}
|
||||
|
||||
if (--this->unk70 == 0) {
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
extern const ScreenTransitionData gUnk_0813ABD0;
|
||||
|
||||
extern u32 sub_08079F8C(void);
|
||||
struct GyorgChildSpawns {
|
||||
s16 offsetX;
|
||||
s16 offsetY;
|
||||
|
||||
@@ -53,7 +53,7 @@ void sub_080866D8(Entity* this) {
|
||||
if ((*((u32*)(&this->field_0x68)) & mask) == 0 && sub_080867CC(prop->unk5) &&
|
||||
CheckRegionOnScreen(prop->unk0, prop->unk2, 32, 32)) {
|
||||
entity = CreateObject(HOUSE_DOOR_EXT, prop->unk7, prop->unk6);
|
||||
if (entity) {
|
||||
if (entity != NULL) {
|
||||
entity->field_0x6c.HALF.LO = i;
|
||||
entity->x.HALF.HI = gRoomControls.origin_x + prop->unk0 + 16;
|
||||
entity->y.HALF.HI = gRoomControls.origin_y + prop->unk2 + 32;
|
||||
@@ -157,7 +157,7 @@ static void sub_080868EC(Entity* entity, unk_80868EC* arg1) {
|
||||
void sub_0808692C(Entity* this) {
|
||||
this->flags &= ~ENT_SCRIPTED;
|
||||
this->type2 = 2;
|
||||
this->action = this->frameIndex == 0 ? 1 : 2;
|
||||
this->action = (this->frameIndex == 0) ? 1 : 2;
|
||||
this->subAction = 0;
|
||||
this->actionDelay = 8;
|
||||
}
|
||||
|
||||
+10
-10
@@ -4,7 +4,7 @@
|
||||
extern u16 gUnk_08123318[];
|
||||
|
||||
static void sub_08097B24(Entity* this);
|
||||
static u32 sub_08097ADC(Entity* this);
|
||||
static bool32 sub_08097ADC(Entity* this);
|
||||
|
||||
void LilypadSmall(Entity* this) {
|
||||
u32 rand;
|
||||
@@ -29,19 +29,19 @@ void LilypadSmall(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
static u32 sub_08097ADC(Entity* this) {
|
||||
if ((gPlayerState.flags & PL_MINISH) == 0) {
|
||||
return 0;
|
||||
static bool32 sub_08097ADC(Entity* this) {
|
||||
if (!(gPlayerState.flags & PL_MINISH)) {
|
||||
return FALSE;
|
||||
} else if (EntityInRectRadius(this, &gPlayerEntity, 8, 8) == 0) {
|
||||
return 0;
|
||||
} else if (sub_08079F8C() == 0) {
|
||||
return 0;
|
||||
return FALSE;
|
||||
} else if (!sub_08079F8C()) {
|
||||
return FALSE;
|
||||
} else {
|
||||
gPlayerState.field_0x14 = 1;
|
||||
if (gPlayerEntity.z.HALF.HI != 0) {
|
||||
return 0;
|
||||
return FALSE;
|
||||
} else {
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ static void sub_08097B24(Entity* this) {
|
||||
u16* temp3;
|
||||
|
||||
if (--this->actionDelay == 0) {
|
||||
this->actionDelay = 0x5a;
|
||||
this->actionDelay = 90;
|
||||
this->frameIndex = (this->frameIndex + 1) & 3;
|
||||
}
|
||||
temp3 = gUnk_08123318;
|
||||
|
||||
@@ -195,7 +195,7 @@ void sub_0808F3DC(Entity* this) {
|
||||
|
||||
if (this->type == 5 && (this->frame & 1)) {
|
||||
Entity* entity = CreateObjectWithParent(this->child, 0x49, 8, 0);
|
||||
if (entity) {
|
||||
if (entity != NULL) {
|
||||
entity->parent = this->parent;
|
||||
entity->child = this->parent->parent;
|
||||
}
|
||||
@@ -262,19 +262,19 @@ void sub_0808F554(Entity* this) {
|
||||
|
||||
void sub_0808F5EC(Entity* this) {
|
||||
Entity* entity = CreateObjectWithParent(this->child, 0x49, 5, 0);
|
||||
if (entity) {
|
||||
if (entity != NULL) {
|
||||
entity->parent = this;
|
||||
entity->child = this->child;
|
||||
}
|
||||
|
||||
entity = CreateObjectWithParent(this->child, 0x49, 6, 0);
|
||||
if (entity) {
|
||||
if (entity != NULL) {
|
||||
entity->parent = this;
|
||||
entity->child = this->child;
|
||||
}
|
||||
|
||||
entity = CreateObjectWithParent(this->child, 0x49, 7, 0);
|
||||
if (entity) {
|
||||
if (entity != NULL) {
|
||||
entity->parent = this;
|
||||
entity->child = this->child;
|
||||
}
|
||||
|
||||
+1
-1
@@ -283,7 +283,7 @@ u32 sub_0808288C(Entity* this, u32 form, u32 arg2, u32 arg3) {
|
||||
break;
|
||||
default:
|
||||
entity = CreateObjectWithParent(this, GROUND_ITEM, form, arg2);
|
||||
if (entity) {
|
||||
if (entity != NULL) {
|
||||
if (arg3 == 2) {
|
||||
entity->actionDelay = 5;
|
||||
entity->field_0x86.HWORD = this->field_0x86.HWORD;
|
||||
|
||||
@@ -144,6 +144,7 @@ void sub_080844E0(SpecialFxObject* this) {
|
||||
static const u8 gUnk_0811FAC8[] = { 0x03, 0x37, 0x38, 0x39 };
|
||||
static const u8 gUnk_0811FACC[] = { 0x17, 0x3e, 0x3f, 0x40 };
|
||||
const struct_0811F960* ptr;
|
||||
|
||||
super->action = 1;
|
||||
super->flags &= ~0x80;
|
||||
super->spriteSettings.draw = 1;
|
||||
@@ -219,7 +220,7 @@ void sub_08084680(SpecialFxObject* this) {
|
||||
}
|
||||
|
||||
void sub_08084694(SpecialFxObject* this) {
|
||||
if (!super->parent || !super->parent->next) {
|
||||
if ((super->parent == NULL) || (super->parent->next == NULL)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
GetNextFrame(super);
|
||||
@@ -253,12 +254,15 @@ void sub_080846B0(SpecialFxObject* this) {
|
||||
|
||||
void sub_0808471C(SpecialFxObject* this) {
|
||||
static const s8 gUnk_0811FB08[] = { -8, -8, 8, -8, -8, 8, 8, 8 };
|
||||
|
||||
GetNextFrame(super);
|
||||
if (super->frame & ANIM_DONE) {
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
Entity* fx = CreateFx(super, 0x24, 0);
|
||||
if (fx) {
|
||||
|
||||
if (fx != NULL) {
|
||||
const s8* ptr = &gUnk_0811FB08[2 * i];
|
||||
fx->x.HALF.HI += ptr[0];
|
||||
fx->y.HALF.HI += ptr[1];
|
||||
@@ -280,7 +284,7 @@ void sub_08084784(SpecialFxObject* this) {
|
||||
|
||||
void sub_08084798(SpecialFxObject* this) {
|
||||
GetNextFrame(super);
|
||||
if ((super->frame & ANIM_DONE) || !super->child->next) {
|
||||
if ((super->frame & ANIM_DONE) || (super->child->next == NULL)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -264,7 +264,7 @@ void CreateSparkle(Entity* entity) {
|
||||
}
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/objectUtils/sub_080A2BE4.inc", void sub_080A2BE4(Entity* this, u32 param_2)) {
|
||||
NONMATCH("asm/non_matching/objectUtils/sub_080A2BE4.inc", void sub_080A2BE4(Entity* this, bool32 param_2)) {
|
||||
s16 oldValue;
|
||||
s32 diff;
|
||||
u16 newValue;
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ NONMATCH("asm/non_matching/LoadRoomEntity.inc", Entity* LoadRoomEntity(EntityDat
|
||||
if (kind == 9)
|
||||
return v5;
|
||||
sub_0804AF0C(v5, dat);
|
||||
if (!v5->next)
|
||||
if (v5->next == NULL)
|
||||
return v5;
|
||||
if ((dat->kind & 0x10) == 0) {
|
||||
if ((dat->kind & 0x20) != 0) {
|
||||
|
||||
+1
-1
@@ -349,7 +349,7 @@ void ExecuteScriptForEntity(Entity* entity, void (*postScriptCallback)(Entity*,
|
||||
} else {
|
||||
HandlePostScriptActions(entity, *piVar1);
|
||||
}
|
||||
if (!entity->next) {
|
||||
if (entity->next == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user