ResetPlayer decompile

This commit is contained in:
Tal Hayon
2022-01-06 14:18:27 +02:00
parent e27bfa5a8b
commit ba5155b3ac
5 changed files with 41 additions and 69 deletions
+1 -1
View File
@@ -1256,7 +1256,7 @@ static void PlayerTalkEzlo(Entity* this) {
static void PlayerTalkEzloInit(Entity* this) {
ResetPlayer();
gUnk_03000B80.filler[0x63] = 0;
gUnk_03000B80[3].field_0xf = 0;
this->iframes = 0;
gPriorityHandler.sys_priority = PRIO_PLAYER_EVENT;
this->updatePriority = PRIO_PLAYER_EVENT;
+38
View File
@@ -0,0 +1,38 @@
#include "player.h"
#include "functions.h"
void ResetPlayer() {
u32 index = 0;
ItemBehavior* ptr = gUnk_03000B80;
do {
sub_08077E78(ptr, index);
ptr++;
index++;
} while (index <= 2);
gPlayerState.field_0x3c[1] = 0;
gPlayerState.field_0x1c = 0;
gPlayerState.field_0x1f[2] = 0;
gPlayerState.field_0x0[1] = 0;
gPlayerState.field_0xe = 0;
gPlayerState.dash_state = 0;
gPlayerState.sword_state = 0;
gPlayerState.field_0x3[0] = 0;
gPlayerState.heldObject = 0;
gPlayerState.flags &= 0xf7fbffff;
gPlayerEntity.field_0x70.WORD = 0;
if ((gPlayerState.jump_status & 0xc0) == 0) {
gPlayerState.jump_status = 0;
}
switch (gPlayerState.framestate) {
case 2:
case 3:
case 4: {
gPlayerState.framestate = 0;
break;
}
}
}