CAMERA_MODE_NONE crash fix (#278)

This commit is contained in:
Isaac0-dev 2023-02-17 09:55:05 +10:00 committed by GitHub
parent 4e293712fd
commit 1fd2ab86c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2912,7 +2912,9 @@ void set_camera_mode(struct Camera *c, s16 mode, s16 frames) {
vec3f_copy(end->pos, c->pos);
vec3f_sub(end->pos, sMarioCamState->pos);
sAreaYaw = sModeTransitions[sModeInfo.newMode](c, end->focus, end->pos);
if (sModeInfo.newMode != CAMERA_MODE_NONE) {
sAreaYaw = sModeTransitions[sModeInfo.newMode](c, end->focus, end->pos);
}
// End was updated by sModeTransitions
vec3f_sub(end->focus, sMarioCamState->pos);