mirror of https://github.com/zeldaret/tmc.git
Merge pull request #470 from hatal175/actiondelay
Change --x !=/== 0xff comparisons
This commit is contained in:
commit
ea34ee76f4
|
@ -242,7 +242,7 @@ void sub_0802AB40(Entity* this) {
|
|||
this->field_0xf = 0x4;
|
||||
this->field_0x80.HALF.LO ^= 1;
|
||||
}
|
||||
} else if ((--this->field_0xf & 0xff) == 0) {
|
||||
} else if (--this->field_0xf == 0) {
|
||||
sub_0802ACDC(this, 4);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -408,7 +408,7 @@ void sub_08046EF4(GyorgMaleEntity* this) {
|
|||
super->direction ^= 0x80;
|
||||
}
|
||||
super->speed = gUnk_080D1B74[(super->actionDelay >> 3) & 0xF];
|
||||
if ((--super->field_0xf & 0xFF) == 0) {
|
||||
if (--super->field_0xf == 0) {
|
||||
Entity* tmp;
|
||||
super->field_0xf = (Random() & 0x38) + 0x78;
|
||||
tmp = CreateProjectile(GYORG_MALE_ENERGY_PROJECTILE);
|
||||
|
|
|
@ -59,7 +59,7 @@ void sub_080765E0(ItemBehavior* this, u32 arg1) {
|
|||
|
||||
void sub_0807660C(ItemBehavior* this, u32 arg1) {
|
||||
UpdateItemAnim(this);
|
||||
if ((--this->field_0x5[2] == 0xff) || (gPlayerState.field_0x0[1] == 0)) {
|
||||
if ((this->field_0x5[2]-- == 0) || (gPlayerState.field_0x0[1] == 0)) {
|
||||
gPlayerState.field_0x0[1] = 0;
|
||||
DeletePlayerItem(this, arg1);
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ void sub_080919AC(MinecartEntity* this) {
|
|||
SoundReq(SFX_138);
|
||||
}
|
||||
|
||||
if (--super->field_0xf == 0xff) {
|
||||
if (super->field_0xf-- == 0) {
|
||||
SoundReq(SFX_PLY_VO7);
|
||||
super->field_0xf = 0x3c;
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ void sub_08082098(Entity* this) {
|
|||
if (this->animIndex != animIndex) {
|
||||
this->z.WORD = 0;
|
||||
this->actionDelay = 6;
|
||||
} else if (--this->actionDelay == 0xff) {
|
||||
} else if (this->actionDelay-- == 0) {
|
||||
switch (this->spriteOffsetY) {
|
||||
case 0:
|
||||
this->spriteOffsetY = -2;
|
||||
|
|
|
@ -52,7 +52,7 @@ void sub_08089BA0(Entity* this) {
|
|||
return;
|
||||
case 1:
|
||||
case 2:
|
||||
if (--this->actionDelay != 0xff)
|
||||
if (this->actionDelay-- != 0)
|
||||
return;
|
||||
if (this->type == 2) {
|
||||
sub_0807B7D8(((u16*)this->child)[3], COORD_TO_TILE(this), this->collisionLayer);
|
||||
|
|
|
@ -217,7 +217,7 @@ void sub_0808F498(Entity* this) {
|
|||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
if (--this->actionDelay == 0xFF) {
|
||||
if (this->actionDelay-- == 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ void Object79_Action2(Object79Entity* this) {
|
|||
this->objDir.WORD += this->unk74;
|
||||
this->objDir.HALF.HI = DirectionNormalize(this->objDir.HALF.HI);
|
||||
this->unk74 += 0x140;
|
||||
if (--super->field_0xf == 0xff) {
|
||||
if (super->field_0xf-- == 0) {
|
||||
super->field_0xf = 30;
|
||||
super->actionDelay ^= 1;
|
||||
}
|
||||
|
|
|
@ -170,7 +170,7 @@ void sub_08082614(Entity* this) {
|
|||
u32 tileType;
|
||||
|
||||
sub_0800445C(this);
|
||||
if (--this->actionDelay != 0xFF) {
|
||||
if (this->actionDelay-- != 0) {
|
||||
LinearMoveUpdate(this);
|
||||
sub_08016A6C(this);
|
||||
return;
|
||||
|
|
|
@ -199,7 +199,7 @@ void sub_0808ADF0(PullableMushroomEntity* this) {
|
|||
SoundReq(SFX_12E);
|
||||
} else {
|
||||
GetNextFrame(super);
|
||||
if (((super->frame & ANIM_DONE) != 0) && (--super->actionDelay == 0xff)) {
|
||||
if (((super->frame & ANIM_DONE) != 0) && (super->actionDelay-- == 0)) {
|
||||
InitializeAnimation(super, super->animationState + 0xd);
|
||||
}
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ void sub_0808AEB0(PullableMushroomEntity* this) {
|
|||
GetNextFrame(super);
|
||||
if (uVar1 < 0x40) {
|
||||
sub_080044AE(&gPlayerEntity, 0x40, super->direction);
|
||||
if (--this->unk_7c == 0xffffffff) {
|
||||
if (this->unk_7c-- == 0) {
|
||||
this->unk_7c = 4;
|
||||
SoundReq(SFX_12F);
|
||||
}
|
||||
|
|
24
src/player.c
24
src/player.c
|
@ -723,7 +723,7 @@ static void PlayerBounceUpdate(Entity* this) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (--this->actionDelay != 0xFF) {
|
||||
if (this->actionDelay-- != 0) {
|
||||
this->zVelocity = Q_16_16(1.0);
|
||||
return;
|
||||
}
|
||||
|
@ -969,7 +969,7 @@ static void sub_08071208(Entity* this) {
|
|||
}
|
||||
}
|
||||
|
||||
if (--this->actionDelay == 0xff) {
|
||||
if (this->actionDelay-- == 0) {
|
||||
gPlayerState.jump_status = 0;
|
||||
ResetPlayerAnimationAndAction();
|
||||
}
|
||||
|
@ -1114,7 +1114,7 @@ static void PortalStandUpdate(Entity* this) {
|
|||
if (this->direction != gPlayerState.field_0xd) {
|
||||
this->actionDelay = 8;
|
||||
}
|
||||
if (--this->actionDelay == 0xff) {
|
||||
if (this->actionDelay-- == 0) {
|
||||
this->direction = gPlayerState.field_0xd;
|
||||
this->animationState = Direction8ToAnimationState(this->direction);
|
||||
this->zVelocity = Q_16_16(2.0);
|
||||
|
@ -1796,7 +1796,7 @@ static void sub_08072064(Entity* this) {
|
|||
static void sub_08072098(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (this->actionDelay != 0)
|
||||
if (--this->actionDelay != 0xFF)
|
||||
if (this->actionDelay-- != 0)
|
||||
return;
|
||||
else
|
||||
;
|
||||
|
@ -1850,7 +1850,7 @@ static void sub_08072168(Entity* this) {
|
|||
}
|
||||
gPlayerState.field_0xd = this->direction;
|
||||
UpdatePlayerCollision();
|
||||
if (--this->actionDelay == 0xff) {
|
||||
if (this->actionDelay-- == 0) {
|
||||
this->knockbackDuration = 0;
|
||||
COLLISION_ON(this);
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
|
@ -1954,7 +1954,7 @@ static void sub_08072354(Entity* this) {
|
|||
|
||||
static void sub_080723D0(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (--this->actionDelay == 0xff) {
|
||||
if (this->actionDelay-- == 0) {
|
||||
this->spritePriority.b1 = 1;
|
||||
this->iframes = 20;
|
||||
ModHealth(-2);
|
||||
|
@ -1963,7 +1963,7 @@ static void sub_080723D0(Entity* this) {
|
|||
}
|
||||
|
||||
static void sub_0807240C(Entity* this) {
|
||||
if (--this->knockbackDuration == 0xff) {
|
||||
if (this->knockbackDuration-- == 0) {
|
||||
this->spriteSettings.draw = 3;
|
||||
this->iframes = 20;
|
||||
gPlayerState.flags &= ~PL_BURNING;
|
||||
|
@ -1989,7 +1989,7 @@ static void sub_0807246C(Entity* this) {
|
|||
}
|
||||
|
||||
static void sub_08072490(Entity* this) {
|
||||
if (--this->actionDelay != 0xff) {
|
||||
if (this->actionDelay-- != 0) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
UpdatePlayerMovement();
|
||||
} else {
|
||||
|
@ -2111,7 +2111,7 @@ static void PlayerRollUpdate(Entity* this) {
|
|||
}
|
||||
|
||||
this->direction = Direction8FromAnimationState(AnimationStateIdle(this->animationState));
|
||||
if (((gPlayerState.flags & PL_MINISH) == 0) && (--this->actionDelay == 0xff)) {
|
||||
if (((gPlayerState.flags & PL_MINISH) == 0) && (this->actionDelay-- == 0)) {
|
||||
CreateFx(&gPlayerEntity, FX_DASH, 0x40);
|
||||
this->actionDelay = 4;
|
||||
}
|
||||
|
@ -2355,7 +2355,7 @@ static void sub_08072CC0(Entity* this) {
|
|||
|
||||
static void sub_08072CFC(Entity* this) {
|
||||
sub_080042BA(this, 2);
|
||||
if (--this->field_0xf != 0xff) {
|
||||
if (this->field_0xf-- != 0) {
|
||||
LinearMoveUpdate(this);
|
||||
return;
|
||||
}
|
||||
|
@ -2464,7 +2464,7 @@ void sub_08072D54(Entity* this) {
|
|||
}
|
||||
|
||||
/*static*/ void sub_08072F14(Entity* this) {
|
||||
if (--this->actionDelay != 0xff) {
|
||||
if (this->actionDelay-- != 0) {
|
||||
sub_0807921C();
|
||||
} else {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
|
@ -3121,7 +3121,7 @@ void sub_08073B8C(Entity* this) {
|
|||
}
|
||||
|
||||
void sub_08073C30(Entity* this) {
|
||||
if (!gPlayerState.field_0x3[1] || --this->actionDelay == 0xFF) {
|
||||
if (!gPlayerState.field_0x3[1] || this->actionDelay-- == 0) {
|
||||
sub_08073B60(this);
|
||||
} else {
|
||||
COLLISION_ON(this);
|
||||
|
|
|
@ -68,7 +68,7 @@ void PlayerItemGustJar_Action2(Entity* this) {
|
|||
this->type = 2;
|
||||
} else {
|
||||
sub_080ADCDC(this, 1);
|
||||
if (--this->actionDelay == 0xff) {
|
||||
if (this->actionDelay-- == 0) {
|
||||
sub_080ADCA0(this, 0);
|
||||
this->type = 0;
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ void GleerokProjectile_Action1(Entity* this) {
|
|||
} else {
|
||||
GetNextFrame(this);
|
||||
LinearMoveUpdate(this);
|
||||
if ((this->type != 2) && (--this->field_0xf == 0xff)) {
|
||||
if ((this->type != 2) && (this->field_0xf-- == 0)) {
|
||||
this->field_0xf = 0x1e;
|
||||
sub_08004596(this, GetFacingDirection(this, &gPlayerEntity));
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ void GleerokProjectile_Action1(Entity* this) {
|
|||
void GleerokProjectile_Action2(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->type == 2) {
|
||||
if (--this->actionDelay == 0xff) {
|
||||
if (this->actionDelay-- == 0) {
|
||||
COLLISION_OFF(this);
|
||||
this->action = 3;
|
||||
InitializeAnimation(this, 0x55);
|
||||
|
|
|
@ -175,7 +175,7 @@ void OctorokBossProjectile_Action1(Entity* this) {
|
|||
break;
|
||||
case 2:
|
||||
GetNextFrame(this);
|
||||
if (--this->actionDelay != 0xff) {
|
||||
if (this->actionDelay-- != 0) {
|
||||
LinearMoveAngle(this, this->speed, this->direction);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue