mirror of
https://github.com/zeldaret/tmc
synced 2026-06-15 14:31:48 -04:00
Fix a lot of pointer comparisons to 0 (or nothing) to explicitly use NULL
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -403,7 +403,7 @@ void AcroBandit_Type1Action3(Entity* this) {
|
||||
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);
|
||||
|
||||
+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));
|
||||
}
|
||||
}
|
||||
|
||||
+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);
|
||||
|
||||
+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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user