diff options
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; + } + } +} |
