improve free camera reset (#3225)

This commit is contained in:
Adam Bird 2023-10-30 11:55:26 -04:00 committed by GitHub
parent dab070a8a1
commit 671ce062d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2138,8 +2138,6 @@ s32 Camera_Parallel1(Camera* camera) {
OLib_Vec3fDiffToVecSphGeo(&atToEyeDir, at, eye);
OLib_Vec3fDiffToVecSphGeo(&atToEyeNextDir, at, eyeNext);
camera->play->manualCamera = false;
switch (camera->animState) {
case 0:
case 0xA:
@ -7888,6 +7886,15 @@ s32 Camera_ChangeModeFlags(Camera* camera, s16 mode, u8 flags) {
break;
}
}
// Clear free camera if an action is performed that would move the camera (targeting, first person, talking)
if (CVarGetInteger("gFreeCamera", 0) && SetCameraManual(camera) == 1 &&
((mode >= CAM_MODE_TARGET && mode <= CAM_MODE_BATTLE) ||
(mode >= CAM_MODE_FIRSTPERSON && mode <= CAM_MODE_CLIMBZ) || mode == CAM_MODE_HANGZ ||
mode == CAM_MODE_FOLLOWBOOMERANG)) {
camera->play->manualCamera = false;
}
func_8005A02C(camera);
camera->mode = mode;
return 0x80000000 | mode;