Disable camera lookback during loops.

This commit is contained in:
Kimberly Wilber 2024-06-16 15:00:55 -04:00
parent c62dfa20d2
commit c4154470b9

View file

@ -3193,6 +3193,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
sonicloopcamvars_t *loop = &player->loop.camera; sonicloopcamvars_t *loop = &player->loop.camera;
tic_t loop_out = leveltime - loop->enter_tic; tic_t loop_out = leveltime - loop->enter_tic;
tic_t loop_in = max(leveltime, loop->exit_tic) - loop->exit_tic; tic_t loop_in = max(leveltime, loop->exit_tic) - loop->exit_tic;
boolean affected_by_loop = (loop_out <=
(loop->zoom_in_speed + loop->zoom_out_speed) && leveltime > introtime);
thiscam->old_x = thiscam->x; thiscam->old_x = thiscam->x;
thiscam->old_y = thiscam->y; thiscam->old_y = thiscam->y;
@ -3406,8 +3408,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
} }
else if (player->exiting) // SRB2Kart: Leave the camera behind while exiting, for dramatic effect! else if (player->exiting) // SRB2Kart: Leave the camera behind while exiting, for dramatic effect!
camstill = true; camstill = true;
else if (lookback || lookbackdelay[num]) // SRB2kart - Camera flipper else if ((lookback || lookbackdelay[num]) && !affected_by_loop)
{ {
// SRB2Kart -- Camera flip when looking backwards
#define MAXLOOKBACKDELAY 2 #define MAXLOOKBACKDELAY 2
camspeed = FRACUNIT; camspeed = FRACUNIT;
if (lookback) if (lookback)
@ -3622,7 +3625,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
thiscam->momx = x - thiscam->x; thiscam->momx = x - thiscam->x;
thiscam->momy = y - thiscam->y; thiscam->momy = y - thiscam->y;
if (lookback && lookbackdelay[num]) { if (lookback && lookbackdelay[num] && !affected_by_loop) {
// when looking back, camera's momentum // when looking back, camera's momentum
// should inherit the momentum of the player // should inherit the momentum of the player
// plus extra // plus extra