mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-12-22 16:30:23 +00:00
Fix going OOB sometimes crashing the game (#517)
* Fixed going OOB sometimes crashing the game * Avoid nested if statements * Update camera.c --------- Co-authored-by: PeachyPeach <72323920+PeachyPeachSM64@users.noreply.github.com>
This commit is contained in:
parent
1cb69df30f
commit
5767ae985f
1 changed files with 2 additions and 4 deletions
|
@ -7199,15 +7199,13 @@ void find_mario_floor_and_ceil(struct PlayerGeometry *pg) {
|
|||
s16 tempCheckingSurfaceCollisionsForCamera = gCheckingSurfaceCollisionsForCamera;
|
||||
gCheckingSurfaceCollisionsForCamera = TRUE;
|
||||
|
||||
if (find_floor(sMarioCamState->pos[0], sMarioCamState->pos[1] + 10.f,
|
||||
sMarioCamState->pos[2], &surf) != gLevelValues.floorLowerLimit) {
|
||||
if (find_floor(sMarioCamState->pos[0], sMarioCamState->pos[1] + 10.f, sMarioCamState->pos[2], &surf) != gLevelValues.floorLowerLimit && surf != NULL) {
|
||||
pg->currFloorType = surf->type;
|
||||
} else {
|
||||
pg->currFloorType = 0;
|
||||
}
|
||||
|
||||
if (find_ceil(sMarioCamState->pos[0], sMarioCamState->pos[1] - 10.f,
|
||||
sMarioCamState->pos[2], &surf) != gLevelValues.cellHeightLimit) {
|
||||
if (find_ceil(sMarioCamState->pos[0], sMarioCamState->pos[1] - 10.f, sMarioCamState->pos[2], &surf) != gLevelValues.cellHeightLimit && surf != NULL) {
|
||||
pg->currCeilType = surf->type;
|
||||
} else {
|
||||
pg->currCeilType = 0;
|
||||
|
|
Loading…
Reference in a new issue