diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2025-05-23 16:53:14 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-23 16:53:14 -0600 |
| commit | 2a0c0939c780babc45c8c22dfd6f94563485bae5 (patch) | |
| tree | 0a8f7d6a5a99452645260d53e778204327275deb /src/player_controller.c | |
| parent | 9363e3d77631b1028a765c075a00293bd20c9ba7 (diff) | |
Refactor World::Courses to unique_ptr (#211)
* wip course unique ptr
* Track unique_ptr : This probably compiles
* Finish impl Courses as unique_ptr
* Fix error
* Fixes
* More fixes
* Cleanup
* Remove old vars
---------
Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/player_controller.c')
| -rw-r--r-- | src/player_controller.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/player_controller.c b/src/player_controller.c index df4b794bb..46038dbda 100644 --- a/src/player_controller.c +++ b/src/player_controller.c @@ -1711,7 +1711,7 @@ void func_8002C11C(Player* player) { } void func_8002C17C(Player* player, s8 playerId) { - if (GetCourse() == GetYoshiValley()) { + if (IsYoshiValley()) { if ((player->collision.surfaceDistance[2] >= 600.0f) && (D_80165330[playerId] == 0)) { D_80165330[playerId] = 1; gCopyNearestWaypointByPlayerId[playerId] = gNearestWaypointByPlayerId[playerId]; @@ -1724,7 +1724,7 @@ void func_8002C17C(Player* player, s8 playerId) { D_80165330[playerId] = 0; } } - } else if (GetCourse() == GetFrappeSnowland()) { + } else if (IsFrappeSnowland()) { if ((player->surfaceType == SNOW_OFFROAD) && (D_80165330[playerId] == 0)) { D_80165330[playerId] = 1; gCopyNearestWaypointByPlayerId[playerId] = gNearestWaypointByPlayerId[playerId]; @@ -1734,7 +1734,7 @@ void func_8002C17C(Player* player, s8 playerId) { gCopyNearestWaypointByPlayerId[playerId] = gNearestWaypointByPlayerId[playerId]; gCopyPathIndexByPlayerId[playerId] = gPathIndexByPlayerId[playerId]; } - } else if (GetCourse() == GetRoyalRaceway()) { + } else if (IsRoyalRaceway()) { if (((player->effects & BOOST_RAMP_ASPHALT_EFFECT) != 0) && (D_80165330[playerId] == 0)) { D_80165330[playerId] = 1; gCopyNearestWaypointByPlayerId[playerId] = gNearestWaypointByPlayerId[playerId]; @@ -1744,7 +1744,7 @@ void func_8002C17C(Player* player, s8 playerId) { gCopyNearestWaypointByPlayerId[playerId] = gNearestWaypointByPlayerId[playerId]; gCopyPathIndexByPlayerId[playerId] = gPathIndexByPlayerId[playerId]; } - } else if (GetCourse() == GetRainbowRoad()) { + } else if (IsRainbowRoad()) { if ((player->collision.surfaceDistance[2] >= 600.0f) && (D_80165330[playerId] == 0)) { D_80165330[playerId] = 1; gCopyNearestWaypointByPlayerId[playerId] = gNearestWaypointByPlayerId[playerId]; @@ -1778,9 +1778,9 @@ void func_8002C4F8(Player* player, s8 arg1) { if ((player->unk_0DE & 4) != 4) { player->unk_0DE |= 8; player->unk_0DE |= 4; - if ((GetCourse() != GetKoopaTroopaBeach()) && (GetCourse() != GetSkyscraper()) && - (GetCourse() != GetRainbowRoad()) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { - if ((GetCourse() == GetBowsersCastle()) || (GetCourse() == GetBigDonut())) { + if ((!IsKoopaTroopaBeach()) && (!IsSkyscraper()) && + (!IsRainbowRoad()) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { + if ((IsBowsersCastle()) || (IsBigDonut())) { func_800C9060((u8) arg1, 0x1900801CU); } else { func_800C9060((u8) arg1, 0x19008008U); @@ -1788,8 +1788,8 @@ void func_8002C4F8(Player* player, s8 arg1) { } } } - if ((GetCourse() == GetKoopaTroopaBeach()) || (GetCourse() == GetSkyscraper()) || - (GetCourse() == GetRainbowRoad())) { + if ((IsKoopaTroopaBeach()) || (IsSkyscraper()) || + (IsRainbowRoad())) { player->unk_0DE &= ~0x000C; } if ((player->boundingBoxSize < (D_801652A0[arg1] - player->pos[1])) && @@ -2254,7 +2254,7 @@ void func_8002D268(Player* player, UNUSED Camera* camera, s8 screenId, s8 player player->unk_DB4.unkC = 1.5f; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - if (((player->unk_0C2 < 0xB) && (player->unk_0C2 >= 4)) && (GetCourse() == GetBowsersCastle())) { + if (((player->unk_0C2 < 0xB) && (player->unk_0C2 >= 4)) && (IsBowsersCastle())) { func_800CADD0((u8) playerId, player->unk_0C2 / 14.0f); } else { func_800CADD0((u8) playerId, player->unk_0C2 / 25.0f); |
