diff options
| author | Tal Hayon <talhayon1@gmail.com> | 2022-01-06 14:18:27 +0200 |
|---|---|---|
| committer | Tal Hayon <talhayon1@gmail.com> | 2022-01-07 04:11:23 +0200 |
| commit | ba5155b3ac1368eecc2de08c040a52b856fd91a2 (patch) | |
| tree | bb3312eb9a37c3ce2af00c960909a75aab473a55 /src | |
| parent | e27bfa5a8bdbdba7b7f88b7241752ffd21197009 (diff) | |
ResetPlayer decompile
Diffstat (limited to 'src')
| -rw-r--r-- | src/player.c | 2 | ||||
| -rw-r--r-- | src/respawnPlayer.c | 38 |
2 files changed, 39 insertions, 1 deletions
diff --git a/src/player.c b/src/player.c index 0efaaf66..92002cf0 100644 --- a/src/player.c +++ b/src/player.c @@ -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; diff --git a/src/respawnPlayer.c b/src/respawnPlayer.c new file mode 100644 index 00000000..24d23b65 --- /dev/null +++ b/src/respawnPlayer.c @@ -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; + } + } +} |
