Use PlayerFlags where possible

This commit is contained in:
Tal Hayon
2022-01-29 16:21:57 +02:00
parent d34aa9166f
commit b4f8429a2c
16 changed files with 40 additions and 35 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ void BigPushableLever_Idle(BigPushableLeverEntity* this) {
if (sub_08079F8C()) {
gPlayerState.pushedObject = 0x98;
gPlayerState.queued_action = 5;
gPlayerState.flags |= 1;
gPlayerState.flags |= PL_BUSY;
gPlayerEntity.x.HALF.LO = 0;
gPlayerEntity.y.HALF.LO = 0;
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
+2 -2
View File
@@ -90,7 +90,7 @@ void sub_080A1704(GyorgBossObjectEntity* this) {
this->unk_76 = 0xc0;
this->unk_78 = 0xc0;
gRoomTransition.field_0x39 = 1;
gPlayerState.flags |= 0x20000;
gPlayerState.flags |= PL_FLAGS20000;
gPlayerState.startPosX = gRoomControls.origin_x + 0x200;
gPlayerState.startPosY = gRoomControls.origin_y + 0x210;
#ifndef EU
@@ -219,7 +219,7 @@ void sub_080A1B4C(GyorgBossObjectEntity* this) {
this->unk_6e = 0x1a4;
super->direction = 0;
super->speed = 0x60;
gPlayerState.flags &= ~0x20000;
gPlayerState.flags &= ~PL_FLAGS20000;
CopyPosition(&gPlayerEntity, super);
gRoomControls.camera_target = super;
SetPlayerControl(2);
+5 -5
View File
@@ -96,7 +96,7 @@ ASM_FUNC("asm/non_matching/lilypadLarge/sub_080855E8.inc", void sub_080855E8(Lil
void sub_08085A1C(LilypadLargeEntity* this) {
gUnk_0812062C[super->subAction](this);
gPlayerState.flags |= 2;
gPlayerState.flags |= PL_FLAGS2;
sub_08078B48();
}
@@ -196,7 +196,7 @@ void sub_08085C5C(LilypadLargeEntity* this) {
gPlayerEntity.speed = super->speed;
gPlayerEntity.direction = super->direction;
LinearMoveUpdate(&gPlayerEntity);
gPlayerState.flags |= 2;
gPlayerState.flags |= PL_FLAGS2;
if (super->collisionLayer == 1) {
ResetCollisionLayer(&gPlayerEntity);
} else {
@@ -228,7 +228,7 @@ void sub_08085D10(LilypadLargeEntity* this) {
}
void sub_08085D28(LilypadLargeEntity* this) {
if (((gPlayerState.framestate != PL_STATE_TALKEZLO) && ((gPlayerState.flags & 2) != 0)) &&
if (((gPlayerState.framestate != PL_STATE_TALKEZLO) && ((gPlayerState.flags & PL_FLAGS2) != 0)) &&
(sub_080002B4(super, 0, 0x18) == 0x11)) {
super->action = 2;
super->subAction = 0;
@@ -239,7 +239,7 @@ void sub_08085D28(LilypadLargeEntity* this) {
NONMATCH("asm/non_matching/lilypadLarge/sub_08085D60.inc", void sub_08085D60(LilypadLargeEntity* this)) {
u32 r4; // horizontal direction?
u32 r6; // vertical direction?
if ((gPlayerState.flags & 2) != 0) {
if ((gPlayerState.flags & PL_FLAGS2) != 0) {
if (gPlayerState.framestate != PL_STATE_DIE) {
if (gPlayerState.jump_status == 0) {
if ((super->direction & 7) == 0) { // North or South
@@ -351,7 +351,7 @@ void sub_08085F48(LilypadLargeEntity* this) {
super->actionDelay = 0;
}
} else {
if ((gPlayerState.flags & 2) != 0) {
if ((gPlayerState.flags & PL_FLAGS2) != 0) {
if (super->actionDelay != 0) {
if (this->unk_78.WORD_U < 0x1200000) {
this->unk_78.WORD_U += 0x8000;
+1 -1
View File
@@ -69,5 +69,5 @@ void sub_08099ECC(Entity* this) {
CopyPosition(this, &gPlayerEntity);
gPlayerState.queued_action = PLAYER_FALL;
gPlayerState.field_0x34[4] = 0;
gPlayerState.flags |= 0x8000;
gPlayerState.flags |= PL_FLAGS8000;
}
+1 -1
View File
@@ -59,7 +59,7 @@ void PushableLever_Idle(PushableLeverEntity* this) {
if (sub_08079F8C()) {
gPlayerState.pushedObject = 0x90;
gPlayerState.queued_action = 5;
gPlayerState.flags |= 1;
gPlayerState.flags |= PL_BUSY;
gPlayerEntity.x.HALF.LO = 0;
gPlayerEntity.y.HALF.LO = 0;
gPlayerEntity.direction = gPlayerEntity.animationState << 2;