Merge branch 'cameracorrections' into 'master'

A few changes to cameras

See merge request KartKrew/Kart!396
This commit is contained in:
Sal 2021-02-20 20:21:02 -05:00
commit ef1f4bf70c
5 changed files with 15 additions and 11 deletions

View file

@ -823,7 +823,7 @@ void K_ObjectTracking(trackingResult_t *result, vector3_t *point, UINT8 cameraNu
return;
}
if (cam->chase == true)
if (cam->chase == true && !player->spectator)
{
// Use the camera's properties.
viewpointX = cam->x;

View file

@ -7016,6 +7016,11 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue)
return 0;
}
if (player->respawn.state == RESPAWNST_MOVE)
{
return 0;
}
currentSpeed = R_PointToDist2(0, 0, player->mo->momx, player->mo->momy);
if ((currentSpeed <= 0) // Not moving

View file

@ -371,6 +371,12 @@ static void K_MovePlayerToRespawnPoint(player_t *player)
}
// Set angle, regardless of if we're done or not
P_SetPlayerAngle(player, R_PointToAngle2(
player->respawn.wp->mobj->x,
player->respawn.wp->mobj->y,
player->respawn.wp->nextwaypoints[nwp]->mobj->x,
player->respawn.wp->nextwaypoints[nwp]->mobj->y
));
player->drawangle = R_PointToAngle2(
player->mo->x, player->mo->y,
dest.x, dest.y

View file

@ -206,7 +206,7 @@ void P_CalcHeight(player_t *player)
player->bob = FixedMul(cv_movebob.value, bobmul);
if (!P_IsObjectOnGround(mo))
if (!P_IsObjectOnGround(mo) || player->spectator)
{
if (mo->eflags & MFE_VERTICALFLIP)
{
@ -2997,7 +2997,7 @@ void P_ResetCamera(player_t *player, camera_t *thiscam)
if (thiscam->chase && player->mo->health <= 0)
return;
thiscam->chase = true;
thiscam->chase = !player->spectator;
x = player->mo->x - P_ReturnThrustX(player->mo, thiscam->angle, player->mo->radius);
y = player->mo->y - P_ReturnThrustY(player->mo, thiscam->angle, player->mo->radius);
if (player->mo->eflags & MFE_VERTICALFLIP)
@ -4480,11 +4480,6 @@ void P_PlayerThink(player_t *player)
// Allows some turning
P_MovePlayer(player);
}
else if (player->respawn.state == RESPAWNST_MOVE)
{
angle_t angleChange = player->cmd.turning << TICCMD_REDUCE;
P_SetPlayerAngle(player, player->angleturn + angleChange);
}
}
else if (player->mo->reactiontime)
{

View file

@ -1191,9 +1191,7 @@ void R_SetupFrame(player_t *player)
if (i > r_splitscreen)
return; // shouldn't be possible, but just in case
if (player->playerstate == PST_DEAD || gamestate == GS_TITLESCREEN || tutorialmode)
chasecam = true; // force chasecam on
else if (player->spectator) // no spectator chasecam
if (player->spectator) // no spectator chasecam
chasecam = false; // force chasecam off
if (chasecam && !thiscam->chase)