From b34067cb0bdad6e63e830db22a17c5436c8ee9ca Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Sat, 29 Jan 2022 15:43:09 +0200 Subject: [PATCH] Use PlayerActions enum in several places --- src/enemy/businessScrub.c | 2 +- src/enemy/pesto.c | 4 ++-- src/enemy/treeItem.c | 2 +- src/manager/managerF.c | 2 +- src/npc/npc23.c | 4 ++-- src/npc/percy.c | 2 +- src/npc/stockwell.c | 2 +- src/object/mask.c | 2 +- src/object/object6A.c | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c index 5a4bb18a..c47c119f 100644 --- a/src/enemy/businessScrub.c +++ b/src/enemy/businessScrub.c @@ -297,7 +297,7 @@ void sub_08028CE8(Entity* this) { } void sub_08028DE8(Entity* this) { - if (gPlayerEntity.action == 8) { + if (gPlayerEntity.action == PLAYER_ITEMGET) { if (this->field_0x80.HALF.HI == 0) { SetPlayerControl(1); this->field_0x80.HALF.HI = 1; diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c index b52a69fc..6dbb1dbe 100644 --- a/src/enemy/pesto.c +++ b/src/enemy/pesto.c @@ -182,7 +182,7 @@ void sub_080241C0(Entity* this) { switch (this->field_0x80.HALF.LO) { case 0: if (PlayerInRange(this, 3, (gPlayerState.hurtBlinkSpeed != 0) ? 0xa0 : 0x40) && sub_08049FDC(this, 3) && - gPlayerEntity.action != 0x1e) { + gPlayerEntity.action != PLAYER_USEENTRANCE) { this->field_0x80.HALF.LO++; this->speed = 0; sub_08024A14(this, 3, 10); @@ -829,7 +829,7 @@ void sub_08024F50(Entity* this) { gPlayerState.field_0xa = 0; gPlayerState.flags &= ~PL_DISABLE_ITEMS; CopyPosition(this, &gPlayerEntity); - gPlayerEntity.action = 1; + gPlayerEntity.action = PLAYER_NORMAL; COLLISION_ON(&gPlayerEntity); gPlayerEntity.iframes = -0x3c; gPlayerEntity.direction = gPlayerEntity.animationState << 2; diff --git a/src/enemy/treeItem.c b/src/enemy/treeItem.c index 188476a4..3e5eca1e 100644 --- a/src/enemy/treeItem.c +++ b/src/enemy/treeItem.c @@ -80,7 +80,7 @@ static bool32 ShouldSpawnTreeItem(Entity* this) { int expectedStateX, expectedStateY; int playerState; - if (gPlayerEntity.action != 0x6) { + if (gPlayerEntity.action != PLAYER_BOUNCE) { return FALSE; } diff --git a/src/manager/managerF.c b/src/manager/managerF.c index b4e7e442..3cc3aa3a 100644 --- a/src/manager/managerF.c +++ b/src/manager/managerF.c @@ -427,7 +427,7 @@ void sub_080594DC(ManagerF* this) { #if defined(USA) || defined(DEMO_USA) || defined(DEMO_JP) void sub_08059548(ManagerF* this) { SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT); - if (gPlayerEntity.action == 0x16) { + if (gPlayerEntity.action == PLAYER_TALKEZLO) { DeleteThisEntity(); } gInput.heldKeys |= 0x4; diff --git a/src/npc/npc23.c b/src/npc/npc23.c index 40712f6f..c4a9399c 100644 --- a/src/npc/npc23.c +++ b/src/npc/npc23.c @@ -64,7 +64,7 @@ void nullsub_110(void) { void sub_080663D4(Entity* this) { if (this->x.HALF.HI == this->field_0x7c.HALF_U.HI - 8) { - if (gPlayerEntity.action != 0xf) { + if (gPlayerEntity.action != PLAYER_080720DC) { this->action = 4; this->direction = 0; this->speed = 0; @@ -95,7 +95,7 @@ void sub_0806643C(Entity* this) { } void sub_08066474(void) { - if (gPlayerEntity.action != 0xf) { + if (gPlayerEntity.action != PLAYER_080720DC) { gUnk_02034490[0] = 0; } } diff --git a/src/npc/percy.c b/src/npc/percy.c index db53c99d..f6e4f181 100644 --- a/src/npc/percy.c +++ b/src/npc/percy.c @@ -132,7 +132,7 @@ void sub_0806B540(Entity* this) { } break; case 3: - if ((gPlayerEntity.action != 8)) { + if ((gPlayerEntity.action != PLAYER_ITEMGET)) { context->wait = 0x2d; return; } diff --git a/src/npc/stockwell.c b/src/npc/stockwell.c index a7330944..16d7b5f7 100644 --- a/src/npc/stockwell.c +++ b/src/npc/stockwell.c @@ -105,7 +105,7 @@ void sub_080652E4(Entity* this) { if (this->actionDelay != 0) { this->actionDelay -= 1; } else { - if (gPlayerEntity.action != 8) { + if (gPlayerEntity.action != PLAYER_ITEMGET) { this->subAction += 1; MessageNoOverlap(0x2c19, this); } diff --git a/src/object/mask.c b/src/object/mask.c index 5d94288f..17625019 100644 --- a/src/object/mask.c +++ b/src/object/mask.c @@ -58,7 +58,7 @@ void sub_080929A4(Entity* this) { // Probably related to knocking it down void sub_08092A94(Entity* this) { // Check for the first frame of bonking animation - if (gPlayerEntity.action != 6) { + if (gPlayerEntity.action != PLAYER_BOUNCE) { return; } diff --git a/src/object/object6A.c b/src/object/object6A.c index 29dcb2ef..a186efd2 100644 --- a/src/object/object6A.c +++ b/src/object/object6A.c @@ -413,7 +413,7 @@ void sub_08094FA8(Object6AEntity* this) { } break; case 3: - if (gPlayerEntity.action != 12) { + if (gPlayerEntity.action != PLAYER_EMPTYBOTTLE) { super->action = 4; #ifndef EU if (!CheckGlobalFlag(BIN_DOGFOOD)) {