OK sub_0807A5B8

This commit is contained in:
KEKW555 2023-11-29 12:20:59 +05:30 committed by GitHub
parent d05f7dff2d
commit 43f25e93af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 39 additions and 1 deletions

View File

@ -1688,7 +1688,45 @@ void sub_080792BC(s32 speed, u32 direction, u32 field_0x38) {
gPlayerEntity.direction = direction; 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) { bool32 sub_080793E4(u32 param_1) {
u32 tmp; u32 tmp;