summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKEKW555 <152369890+KEKW555@users.noreply.github.com>2023-12-26 11:13:54 +0530
committerGitHub <noreply@github.com>2023-12-25 21:43:54 -0800
commitbd44f07fa6182880f765c5f6a504e7064eef4770 (patch)
tree9d19eedd215ec06aa41b27c7bc81a25df72b61f6 /src
parent4c69055d41bf4a41e992c5816de247b1949d94e5 (diff)
Remove RespawnPlayer fakematch (#666)
* Remove RespawnPlayer fakematch * Remove xtra space
Diffstat (limited to 'src')
-rw-r--r--src/playerUtils.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/src/playerUtils.c b/src/playerUtils.c
index 2391d1e4..cddb108a 100644
--- a/src/playerUtils.c
+++ b/src/playerUtils.c
@@ -1937,10 +1937,7 @@ bool32 sub_080793E4(u32 param_1) {
}
void RespawnPlayer(void) {
- u32* ptr1;
- u32 index;
Entity* player = &gPlayerEntity;
-
player->action = PLAYER_080728AC;
player->z.WORD = 0;
player->zVelocity = 0;
@@ -1951,30 +1948,18 @@ void RespawnPlayer(void) {
player->x.HALF.HI = gPlayerState.lilypad->x.HALF.HI;
player->y.HALF.HI = gPlayerState.lilypad->y.HALF.HI;
} else {
- goto code_1;
- code_0:
- gPlayerEntity.collisionLayer = *ptr1 >> 0x1e;
- gPlayerEntity.x.HALF.HI = gRoomControls.origin_x + (*ptr1 & 0x3f) * 16 + 8;
- gPlayerEntity.y.HALF.HI = gRoomControls.origin_y + (*ptr1 & 0xfc0) / 4 + 8;
- COLLISION_ON(&gPlayerEntity);
- goto code_3;
- code_1:
- index = 0;
- if (gPlayerState.path_memory[0] != 0xffffffff) {
- ptr1 = gPlayerState.path_memory;
- while (sub_080B1B44((u16)*ptr1, *ptr1 >> 0x1e) == 0xf) {
- ptr1++;
- index++;
- if ((index > 0xf) || (*ptr1 == -1)) {
- goto code_3;
- break;
- }
+ u32 i;
+ for (i = 0; i <= 0xf && gPlayerState.path_memory[i] != -1; i++) {
+ if (sub_080B1B44((u16)gPlayerState.path_memory[i], gPlayerState.path_memory[i] >> 0x1e) != 0xf) {
+ gPlayerEntity.collisionLayer = gPlayerState.path_memory[i] >> 0x1e;
+ gPlayerEntity.x.HALF.HI = gRoomControls.origin_x + (gPlayerState.path_memory[i] & 0x3f) * 16 + 8;
+ gPlayerEntity.y.HALF.HI = gRoomControls.origin_y + (gPlayerState.path_memory[i] & 0xfc0) / 4 + 8;
+ COLLISION_ON(&gPlayerEntity);
+ break;
}
- goto code_0;
}
}
}
-code_3:
UpdateSpriteForCollisionLayer(&gPlayerEntity);
}