Skip to content

Commit

Permalink
Merge pull request #632 from KEKW555/OK_sub_080792D8
Browse files Browse the repository at this point in the history
Match sub_080792D8
  • Loading branch information
hytopoulos committed Nov 29, 2023
2 parents d05f7df + 6fec089 commit f54509d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 140 deletions.
139 changes: 0 additions & 139 deletions asm/non_matching/playerUtils/sub_080792D8.inc

This file was deleted.

40 changes: 39 additions & 1 deletion src/playerUtils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,45 @@ void sub_080792BC(s32 speed, u32 direction, u32 field_0x38) {
gPlayerEntity.direction = direction;
}

ASM_FUNC("asm/non_matching/playerUtils/sub_080792D8.inc", void sub_080792D8())
void sub_080792D8(void) {
Entity* playerEntity = &gPlayerEntity;

if (playerEntity->knockbackDuration != 0) {
if (((((playerEntity->action == 0xb) || (gPlayerState.dash_state != 0)) ||
((u8)(gPlayerState.heldObject - 1) < 4)) ||
(((gPlayerState.jump_status != 0 || (gPlayerState.floor_type == 0xff)) ||
(((gPlayerState.field_0x7 & 0x80) != 0 ||
((0 < (s32)((gPlayerState.swim_state & 0xf) - 1) || (playerEntity->action == 3)))))))) ||
((gPlayerState.flags & 0x40000) != 0)) {
playerEntity->knockbackDuration = 0;
} else if ((playerEntity->action == 0x1d) && (playerEntity->knockbackDirection != 0x10)) {
playerEntity->knockbackDuration = 0;
} else {

if ((s8)(playerEntity->knockbackDuration) >= 1) {
playerEntity->knockbackDuration--;

} else {
playerEntity->knockbackDuration++;
}
if (playerEntity->knockbackDuration != 0) {
gPlayerState.field_0x7 &= 0xdf;
if ((((0 < playerEntity->iframes) && (gPlayerState.swim_state == 0)) &&
((gPlayerState.flags & 0x80) == 0)) &&
gPlayerState.jump_status == 0) {
ResetActiveItems();
if ((gPlayerState.flags & 8) == 0) {
gPlayerState.animation = 0x114;
} else {
gPlayerState.animation = 0x418;
}
}
sub_080027EA(playerEntity, 0x280, playerEntity->knockbackDirection);
sub_0807A5B8(playerEntity->knockbackDirection);
}
}
}
}

bool32 sub_080793E4(u32 param_1) {
u32 tmp;
Expand Down

0 comments on commit f54509d

Please sign in to comment.