diff options
| author | Elliptic Ellipsis <elliptic.ellipsis@gmail.com> | 2022-03-25 01:25:02 +0000 |
|---|---|---|
| committer | Elliptic Ellipsis <elliptic.ellipsis@gmail.com> | 2022-03-25 01:25:02 +0000 |
| commit | fa1eb0152882a308bf8fe0e1947c4379adedeb54 (patch) | |
| tree | 7b364584dbaa15c00fafbef760f28d731441a11b /src/object | |
| parent | 1580dd1f2c7a2a576f78c01511dbeda5ac7f7d1b (diff) | |
Use COL_ enum
Diffstat (limited to 'src/object')
| -rw-r--r-- | src/object/playerClone.c | 11 | ||||
| -rw-r--r-- | src/object/smallIceBlock.c | 15 |
2 files changed, 17 insertions, 9 deletions
diff --git a/src/object/playerClone.c b/src/object/playerClone.c index b8a94abc..cabbd7c9 100644 --- a/src/object/playerClone.c +++ b/src/object/playerClone.c @@ -1,5 +1,6 @@ #define NENT_DEPRECATED #include "entity.h" +#include "collision.h" #include "room.h" #include "asm.h" #include "sound.h" @@ -49,7 +50,12 @@ void PlayerClone_Init(PlayerCloneEntity* this) { SoundReq(SFX_112); } -const u16 PlayerCloneCollisions[] = { 0x2206, 0x6044, 0x4460, 0x622 }; +const u16 PlayerCloneCollisions[] = { + COL_NORTH_FULL | COL_WEST_SOUTH | COL_EAST_SOUTH, + COL_NORTH_EAST | COL_SOUTH_EAST | COL_EAST_FULL, + COL_SOUTH_FULL | COL_WEST_NORTH | COL_EAST_NORTH, + COL_NORTH_WEST | COL_SOUTH_WEST | COL_WEST_FULL, +}; void PlayerClone_Action1(PlayerCloneEntity* this) { static const Hitbox PlayerCloneHitbox = { 0, -3, { 5, 3, 3, 5 }, 6, 6 }; @@ -104,7 +110,8 @@ void PlayerClone_Action2(PlayerCloneEntity* this) { super->y.HALF.HI = gPlayerEntity.y.HALF.HI + this->unk7a; sub_08084CAC(this); sub_080085B0(super); - if ((super->collisions & 0x6666) != 0x6666) { + if ((super->collisions & (COL_NORTH_FULL | COL_SOUTH_FULL | COL_EAST_FULL | COL_WEST_FULL)) != + (COL_NORTH_FULL | COL_SOUTH_FULL | COL_EAST_FULL | COL_WEST_FULL)) { for (index = 0; index <= 3; index++) { if (PlayerCloneCollisions[index] == (PlayerCloneCollisions[index] & super->collisions)) { break; diff --git a/src/object/smallIceBlock.c b/src/object/smallIceBlock.c index 11994ed5..63c4c5a6 100644 --- a/src/object/smallIceBlock.c +++ b/src/object/smallIceBlock.c @@ -7,6 +7,7 @@ #define NENT_DEPRECATED #include "global.h" +#include "collision.h" #include "object.h" #include "functions.h" #include "hitbox.h" @@ -204,7 +205,7 @@ bool32 sub_0809953C(SmallIceBlockEntity* this) { uVar3 = sub_0800442E(super); if (uVar3 != 0) { - return 0; + return FALSE; } ProcessMovement2(super); sub_0800445C(super); @@ -216,17 +217,17 @@ bool32 sub_0809953C(SmallIceBlockEntity* this) { } switch (super->direction >> 3) { case 0: - if ((super->collisions & 0xe) == 0) { - return 0; + if ((super->collisions & COL_NORTH_ANY) == COL_NONE) { + return FALSE; } if ((u32)(super->y.HALF.HI & 0xf) - 7 < 3) { super->y.HALF.HI = (super->y.HALF.HI & 0xfff0) + 8; - return 1; + return TRUE; } sub_0809969C(this); break; case 1: - if ((super->collisions & 0xe000) == 0) { + if ((super->collisions & COL_EAST_ANY) == COL_NONE) { return FALSE; } if ((u32)(super->x.HALF.HI & 0xf) - 7 < 3) { @@ -236,7 +237,7 @@ bool32 sub_0809953C(SmallIceBlockEntity* this) { sub_0809969C(this); break; case 2: - if ((super->collisions & 0xe0) == 0) { + if ((super->collisions & COL_SOUTH_ANY) == COL_NONE) { return FALSE; } if ((u32)(super->y.HALF.HI & 0xf) - 7 < 3) { @@ -246,7 +247,7 @@ bool32 sub_0809953C(SmallIceBlockEntity* this) { sub_0809969C(this); break; default: - if ((super->collisions & 0xe00) != 0) { + if ((super->collisions & COL_WEST_ANY) != COL_NONE) { if ((u32)(super->x.HALF.HI & 0xf) - 7 < 3) { super->x.HALF.HI = (super->x.HALF.HI & 0xfff0) + 8; return TRUE; |
