Formatting again

This commit is contained in:
Reinmmar 2023-09-18 19:01:17 +02:00
parent e689c1b32d
commit ed438ebd78
6 changed files with 22 additions and 24 deletions

View File

@ -254,7 +254,8 @@ u32 UpdatePlayerCollision(void) {
if (gPlayerState.field_0xa != 0) { if (gPlayerState.field_0xa != 0) {
return 0; return 0;
} }
if ((Direction8FromAnimationState(gPlayerEntity.animationState)) - gPlayerState.direction != DirectionNorth) { if ((Direction8FromAnimationState(gPlayerEntity.animationState)) - gPlayerState.direction !=
DirectionNorth) {
return 0; return 0;
} }
if ((gPlayerEntity.direction & DIR_NOT_MOVING_CHECK) != 0) { if ((gPlayerEntity.direction & DIR_NOT_MOVING_CHECK) != 0) {
@ -356,7 +357,8 @@ u32 UpdatePlayerCollision(void) {
return 0; return 0;
} }
#endif #endif
if ((Direction8FromAnimationState(gPlayerEntity.animationState)) - gPlayerState.direction != DirectionNorth) { if ((Direction8FromAnimationState(gPlayerEntity.animationState)) - gPlayerState.direction !=
DirectionNorth) {
return 0; return 0;
} }
if ((gPlayerEntity.direction & 0x80) != 0) { if ((gPlayerEntity.direction & 0x80) != 0) {
@ -595,7 +597,8 @@ bool32 sub_0801A2B0(LayerStruct* layer, u32 position, u32 collisionType) {
u16 temp4; u16 temp4;
uVar1 = gUnk_080B4488[gPlayerEntity.animationState >> 1]; uVar1 = gUnk_080B4488[gPlayerEntity.animationState >> 1];
if ((((gPlayerState.field_0x35 | gPlayerState.direction) & DIR_NOT_MOVING_CHECK) == 0) && ((gPlayerEntity.frame & 1) != 0)) { if ((((gPlayerState.field_0x35 | gPlayerState.direction) & DIR_NOT_MOVING_CHECK) == 0) &&
((gPlayerEntity.frame & 1) != 0)) {
position = (u16)(position - (-uVar1)); // necessary for match position = (u16)(position - (-uVar1)); // necessary for match
temp4 = sub_080B1B54(GetTileType(position, gPlayerEntity.collisionLayer)); temp4 = sub_080B1B54(GetTileType(position, gPlayerEntity.collisionLayer));
switch (temp4) { switch (temp4) {

View File

@ -73,7 +73,8 @@ void Leever_Idle(Entity* this) {
if (Leever_PlayerInRange(this, Random() & 0x1f)) { if (Leever_PlayerInRange(this, Random() & 0x1f)) {
this->action = 2; this->action = 2;
this->spriteSettings.draw = TRUE; this->spriteSettings.draw = TRUE;
this->direction = (GetFacingDirection(this, gUnk_020000B0) + gLeeverDrift[Random() & 1]) & (0x3 | DirectionNorthWest); this->direction =
(GetFacingDirection(this, gUnk_020000B0) + gLeeverDrift[Random() & 1]) & (0x3 | DirectionNorthWest);
InitializeAnimation(this, LeeverAnimation_DigUp); InitializeAnimation(this, LeeverAnimation_DigUp);
UpdateSpriteForCollisionLayer(this); UpdateSpriteForCollisionLayer(this);
} else { } else {

View File

@ -182,7 +182,8 @@ void Peahat_ChargeStart(Entity* this) {
this->action = 3; this->action = 3;
this->timer = 120; this->timer = 120;
this->speed = 192; this->speed = 192;
this->direction = (GetFacingDirection(this, gUnk_020000B0) + gUnk_080CA5D4[Random() & 1]) & (0x3 | DirectionNorthWest); this->direction =
(GetFacingDirection(this, gUnk_020000B0) + gUnk_080CA5D4[Random() & 1]) & (0x3 | DirectionNorthWest);
} }
} else { } else {
sub_080205F8(this); sub_080205F8(this);

View File

@ -158,8 +158,8 @@ void sub_08076A88(ItemBehavior* this, u32 index) {
if ((*(u16*)&ptr[(gPlayerEntity.animationState & 0xfe)] & gPlayerState.playerInput.heldInput) == 0) { if ((*(u16*)&ptr[(gPlayerEntity.animationState & 0xfe)] & gPlayerState.playerInput.heldInput) == 0) {
this->direction = (this->playerAnimationState & 0xe) * 4; this->direction = (this->playerAnimationState & 0xe) * 4;
if ((gPlayerState.direction != DIR_NONE) && (gPlayerState.direction != this->direction)) { if ((gPlayerState.direction != DIR_NONE) && (gPlayerState.direction != this->direction)) {
if (((gPlayerState.direction - this->direction) & if (((gPlayerState.direction - this->direction) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast |
(0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest)) < DirectionSouth) { DirectionSouth | DirectionWest)) < DirectionSouth) {
this->direction = this->direction + 2; this->direction = this->direction + 2;
} }
this->direction--; this->direction--;

View File

@ -2165,37 +2165,29 @@ bool32 sub_080AF0C8(Entity* this) {
u32 tileType = GetTileTypeByEntity(this); u32 tileType = GetTileTypeByEntity(this);
switch (tileType) { switch (tileType) {
case 0x87: case 0x87:
if (( if (((this->direction + 7) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth |
(this->direction + 7) & DirectionWest)) < DirectionSouth) {
(0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest)
) < DirectionSouth) {
this->collisions = COL_NORTH_ANY; this->collisions = COL_NORTH_ANY;
return TRUE; return TRUE;
} }
break; break;
case 0x8a: case 0x8a:
if (( if (((this->direction - 1) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth |
(this->direction - 1) & DirectionWest)) < DirectionSouth) {
(0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest)
) < DirectionSouth) {
this->collisions = COL_EAST_ANY; this->collisions = COL_EAST_ANY;
return TRUE; return TRUE;
} }
break; break;
case 0x88: case 0x88:
if (( if (((this->direction - 9) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth |
(this->direction - 9) & DirectionWest)) < DirectionSouth) {
(0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest)
) < DirectionSouth) {
this->collisions = COL_SOUTH_ANY; this->collisions = COL_SOUTH_ANY;
return TRUE; return TRUE;
} }
break; break;
case 0x89: case 0x89:
if (( if (((this->direction - 0x11) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth |
(this->direction - 0x11) & DirectionWest)) < DirectionSouth) {
(0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest)
) < DirectionSouth) {
this->collisions = COL_WEST_ANY; this->collisions = COL_WEST_ANY;
return TRUE; return TRUE;
} }

View File

@ -2645,7 +2645,8 @@ static void sub_0807332C(Entity* this) {
LinearMoveUpdate(this); LinearMoveUpdate(this);
return; return;
} }
this->direction = (this->direction - 1) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest); this->direction = (this->direction - 1) &
(0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest);
} }
LinearMoveUpdate(this); LinearMoveUpdate(this);
return; return;