Merge pull request #641 from Reinmmar/MatchedFunctionReadable

Cleaned this up a bit
This commit is contained in:
notyourav 2023-12-09 16:48:07 -08:00 committed by GitHub
commit 9954f154ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 20 deletions

View File

@ -426,6 +426,7 @@ typedef enum {
ANIM_THROW_NOCAP = 0x930, ANIM_THROW_NOCAP = 0x930,
ANIM_CARRY_NOCAP = 0x934, ANIM_CARRY_NOCAP = 0x934,
ANIM_PUSH_NOCAP = 0x93c, ANIM_PUSH_NOCAP = 0x93c,
ANIM_PULL_START_NOCAP = 0x940,
ANIM_PULL_NOCAP = 0x944, ANIM_PULL_NOCAP = 0x944,
ANIM_GRAB_NOCAP = 0x948, ANIM_GRAB_NOCAP = 0x948,
ANIM_FALL_IN_HOLE_NOCAP = 0x950, ANIM_FALL_IN_HOLE_NOCAP = 0x950,

View File

@ -138,15 +138,15 @@ void sub_080762D8(ItemBehavior* this, u32 index) {
u32 animIndex; u32 animIndex;
gPlayerState.heldObject &= 0xcf; gPlayerState.heldObject &= 0xcf;
if (PlayerTryDropObject(this, index) == 0) { if (!PlayerTryDropObject(this, index)) {
return; return;
} }
if (((gPlayerEntity.iframes < 9) && (gPlayerEntity.knockbackDuration == 0))) { if (gPlayerEntity.iframes < 9 && gPlayerEntity.knockbackDuration == 0) {
if (this->field_0x18 != NULL) { if (this->field_0x18 != NULL) {
if (this->field_0x18->action == 2 && this->field_0x18->subAction == 5) { if (this->field_0x18->action == 2 && this->field_0x18->subAction == 5) {
if ((gPlayerState.playerInput.heldInput & 0x80) == 0) { if (!(gPlayerState.playerInput.heldInput & PLAYER_INPUT_80)) { // Pressing R
this->field_0x18->subAction = 6; // this->field_0x18->subAction = 6;
PlayerCancelHoldItem(this, index); PlayerCancelHoldItem(this, index);
return; return;
} }
@ -156,7 +156,7 @@ void sub_080762D8(ItemBehavior* this, u32 index) {
} }
} }
gPlayerState.framestate = 5; gPlayerState.framestate = PL_STATE_THROW;
gUnk_0200AF00.rActionGrabbing = 8; gUnk_0200AF00.rActionGrabbing = 8;
} else { } else {
if (this->field_0x18 != NULL) { if (this->field_0x18 != NULL) {
@ -166,18 +166,18 @@ void sub_080762D8(ItemBehavior* this, u32 index) {
return; return;
} }
if (gPlayerState.jump_status == 0) { if (!gPlayerState.jump_status) {
if ((gPlayerState.heldObject == 1) && (sub_0800875A(&gPlayerEntity, 6, this) != 0)) { if (gPlayerState.heldObject == 1 && sub_0800875A(&gPlayerEntity, 6, this) != 0) {
sub_08076088(this, NULL, index); sub_08076088(this, NULL, index);
return; return;
} else if ((gUnk_0811BE38[(gPlayerEntity.animationState >> 1)] & gPlayerState.playerInput.heldInput) != 0) { } else if (gUnk_0811BE38[gPlayerEntity.animationState >> 1] & gPlayerState.playerInput.heldInput) {
UpdateItemAnim(this); UpdateItemAnim(this);
if ((gPlayerState.flags & 8) == 0) { if (!(gPlayerState.flags & PL_NO_CAP)) {
animIndex = 0x340; animIndex = ANIM_PULL;
} else { } else {
animIndex = 0x940; animIndex = ANIM_PULL_START_NOCAP;
} }
if (animIndex != this->animIndex) { if (animIndex != this->animIndex) {
@ -185,7 +185,7 @@ void sub_080762D8(ItemBehavior* this, u32 index) {
} }
gPlayerState.heldObject |= 0x10; gPlayerState.heldObject |= 0x10;
gPlayerState.framestate = 0x1a; gPlayerState.framestate = PL_STATE_PULL;
if (gPlayerState.heldObject == 1) { if (gPlayerState.heldObject == 1) {
return; return;
@ -193,7 +193,7 @@ void sub_080762D8(ItemBehavior* this, u32 index) {
sub_08076088(this, this->field_0x18, index); sub_08076088(this, this->field_0x18, index);
} else { } else {
if ((gPlayerState.playerInput.heldInput & gUnk_0811BE40[(gPlayerEntity.animationState >> 1)]) != 0) { if (gPlayerState.playerInput.heldInput & gUnk_0811BE40[gPlayerEntity.animationState >> 1]) {
if (gPlayerEntity.subtimer < 6) { if (gPlayerEntity.subtimer < 6) {
gPlayerEntity.subtimer++; gPlayerEntity.subtimer++;
return; return;
@ -202,12 +202,12 @@ void sub_080762D8(ItemBehavior* this, u32 index) {
gPlayerState.field_0x35 = this->playerAnimationState; gPlayerState.field_0x35 = this->playerAnimationState;
gPlayerState.pushedObject |= 0x80; gPlayerState.pushedObject |= 0x80;
gPlayerState.heldObject |= 0x20; gPlayerState.heldObject |= 0x20;
gPlayerState.framestate = 0x19; gPlayerState.framestate = PL_STATE_PUSH;
if ((gPlayerState.flags & 8) == 0) { if (!(gPlayerState.flags & PL_NO_CAP)) {
animIndex = 0x33c; animIndex = ANIM_PUSH;
} else { } else {
animIndex = 0x93c; animIndex = ANIM_PUSH_NOCAP;
} }
if (animIndex == this->animIndex) { if (animIndex == this->animIndex) {
@ -218,10 +218,10 @@ void sub_080762D8(ItemBehavior* this, u32 index) {
} else { } else {
gPlayerEntity.subtimer = 0; gPlayerEntity.subtimer = 0;
if ((gPlayerState.flags & 8) == 0) { if (!(gPlayerState.flags & PL_NO_CAP)) {
SetItemAnim(this, 0x340); SetItemAnim(this, ANIM_PULL);
} else { } else {
SetItemAnim(this, 0x940); SetItemAnim(this, ANIM_PULL_START_NOCAP);
} }
} }
} }