From ed438ebd7855cf3342b61515102e08d42ef7c23e Mon Sep 17 00:00:00 2001 From: Reinmmar Date: Mon, 18 Sep 2023 19:01:17 +0200 Subject: [PATCH] Formatting again --- src/beanstalkSubtask.c | 9 ++++++--- src/enemy/leever.c | 3 ++- src/enemy/peahat.c | 3 ++- src/item/itemPegasusBoots.c | 4 ++-- src/movement.c | 24 ++++++++---------------- src/player.c | 3 ++- 6 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/beanstalkSubtask.c b/src/beanstalkSubtask.c index 15e9dbdf..a183d3bd 100644 --- a/src/beanstalkSubtask.c +++ b/src/beanstalkSubtask.c @@ -254,7 +254,8 @@ u32 UpdatePlayerCollision(void) { if (gPlayerState.field_0xa != 0) { return 0; } - if ((Direction8FromAnimationState(gPlayerEntity.animationState)) - gPlayerState.direction != DirectionNorth) { + if ((Direction8FromAnimationState(gPlayerEntity.animationState)) - gPlayerState.direction != + DirectionNorth) { return 0; } if ((gPlayerEntity.direction & DIR_NOT_MOVING_CHECK) != 0) { @@ -356,7 +357,8 @@ u32 UpdatePlayerCollision(void) { return 0; } #endif - if ((Direction8FromAnimationState(gPlayerEntity.animationState)) - gPlayerState.direction != DirectionNorth) { + if ((Direction8FromAnimationState(gPlayerEntity.animationState)) - gPlayerState.direction != + DirectionNorth) { return 0; } if ((gPlayerEntity.direction & 0x80) != 0) { @@ -595,7 +597,8 @@ bool32 sub_0801A2B0(LayerStruct* layer, u32 position, u32 collisionType) { u16 temp4; 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 temp4 = sub_080B1B54(GetTileType(position, gPlayerEntity.collisionLayer)); switch (temp4) { diff --git a/src/enemy/leever.c b/src/enemy/leever.c index e687ab19..2cfe61cd 100644 --- a/src/enemy/leever.c +++ b/src/enemy/leever.c @@ -73,7 +73,8 @@ void Leever_Idle(Entity* this) { if (Leever_PlayerInRange(this, Random() & 0x1f)) { this->action = 2; 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); UpdateSpriteForCollisionLayer(this); } else { diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c index 9f0ea969..a6ba87da 100644 --- a/src/enemy/peahat.c +++ b/src/enemy/peahat.c @@ -182,7 +182,8 @@ void Peahat_ChargeStart(Entity* this) { this->action = 3; this->timer = 120; 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 { sub_080205F8(this); diff --git a/src/item/itemPegasusBoots.c b/src/item/itemPegasusBoots.c index 8449ee50..68a489c8 100644 --- a/src/item/itemPegasusBoots.c +++ b/src/item/itemPegasusBoots.c @@ -158,8 +158,8 @@ void sub_08076A88(ItemBehavior* this, u32 index) { if ((*(u16*)&ptr[(gPlayerEntity.animationState & 0xfe)] & gPlayerState.playerInput.heldInput) == 0) { this->direction = (this->playerAnimationState & 0xe) * 4; if ((gPlayerState.direction != DIR_NONE) && (gPlayerState.direction != this->direction)) { - if (((gPlayerState.direction - this->direction) & - (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest)) < DirectionSouth) { + if (((gPlayerState.direction - this->direction) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | + DirectionSouth | DirectionWest)) < DirectionSouth) { this->direction = this->direction + 2; } this->direction--; diff --git a/src/movement.c b/src/movement.c index f4e2eea6..51e95932 100644 --- a/src/movement.c +++ b/src/movement.c @@ -2165,37 +2165,29 @@ bool32 sub_080AF0C8(Entity* this) { u32 tileType = GetTileTypeByEntity(this); switch (tileType) { case 0x87: - if (( - (this->direction + 7) & - (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest) - ) < DirectionSouth) { + if (((this->direction + 7) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | + DirectionWest)) < DirectionSouth) { this->collisions = COL_NORTH_ANY; return TRUE; } break; case 0x8a: - if (( - (this->direction - 1) & - (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest) - ) < DirectionSouth) { + if (((this->direction - 1) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | + DirectionWest)) < DirectionSouth) { this->collisions = COL_EAST_ANY; return TRUE; } break; case 0x88: - if (( - (this->direction - 9) & - (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest) - ) < DirectionSouth) { + if (((this->direction - 9) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | + DirectionWest)) < DirectionSouth) { this->collisions = COL_SOUTH_ANY; return TRUE; } break; case 0x89: - if (( - (this->direction - 0x11) & - (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | DirectionWest) - ) < DirectionSouth) { + if (((this->direction - 0x11) & (0x3 | DIR_DIAGONAL | DirectionNorth | DirectionEast | DirectionSouth | + DirectionWest)) < DirectionSouth) { this->collisions = COL_WEST_ANY; return TRUE; } diff --git a/src/player.c b/src/player.c index 0cd9847d..70b98ff6 100644 --- a/src/player.c +++ b/src/player.c @@ -2645,7 +2645,8 @@ static void sub_0807332C(Entity* this) { LinearMoveUpdate(this); 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); return;