Merge branch 'lap-anim-annoying' into 'master'

Lap animation polish

See merge request KartKrew/Kart!1651
This commit is contained in:
AJ Martinez 2023-11-19 23:40:49 +00:00
commit af6b4c503a
2 changed files with 24 additions and 24 deletions

View file

@ -5027,7 +5027,7 @@ static void K_drawLapStartAnim(void)
kp_lapanim_hand[stplyr->karthud[khud_laphand]-1], NULL);
}
if (stplyr->laps == (UINT8)(numlaps))
if (stplyr->latestlap == (UINT8)(numlaps))
{
newval = (62 - (32 * max(0, progress - 76))) * FRACUNIT;
oldval = (62 - (32 * max(0, progressOld - 76))) * FRACUNIT;
@ -5074,7 +5074,7 @@ static void K_drawLapStartAnim(void)
interpx, // 194
30*FRACUNIT, // 24
FRACUNIT, V_SNAPTOTOP|V_HUDTRANS,
kp_lapanim_number[(((UINT32)stplyr->laps) / 10)][min(progress/2-8, 2)], NULL);
kp_lapanim_number[(((UINT32)stplyr->latestlap) / 10)][min(progress/2-8, 2)], NULL);
if (progress/2-10 >= 0)
{
@ -5086,7 +5086,7 @@ static void K_drawLapStartAnim(void)
interpx, // 221
30*FRACUNIT, // 24
FRACUNIT, V_SNAPTOTOP|V_HUDTRANS,
kp_lapanim_number[(((UINT32)stplyr->laps) % 10)][min(progress/2-10, 2)], NULL);
kp_lapanim_number[(((UINT32)stplyr->latestlap) % 10)][min(progress/2-10, 2)], NULL);
}
}
}

View file

@ -1944,27 +1944,6 @@ static void K_HandleLapIncrement(player_t *player)
player->laps++;
// Set up lap animation vars
if (player->laps > 1)
{
if (nump > 1)
{
if (K_IsPlayerLosing(player))
player->karthud[khud_laphand] = 3;
else
{
if (nump > 2 && player->position == 1) // 1st place in 1v1 uses thumbs up
player->karthud[khud_laphand] = 1;
else
player->karthud[khud_laphand] = 2;
}
}
else
player->karthud[khud_laphand] = 0; // No hands in FREE PLAY
player->karthud[khud_lapanimation] = 80;
}
if (G_TimeAttackStart() && !linecrossed)
{
linecrossed = leveltime;
@ -2059,6 +2038,27 @@ static void K_HandleLapIncrement(player_t *player)
}
player->latestlap = player->laps;
// Set up lap animation vars
if (player->latestlap > 1)
{
if (nump > 1)
{
if (K_IsPlayerLosing(player))
player->karthud[khud_laphand] = 3;
else
{
if (nump > 2 && player->position == 1) // 1st place in 1v1 uses thumbs up
player->karthud[khud_laphand] = 1;
else
player->karthud[khud_laphand] = 2;
}
}
else
player->karthud[khud_laphand] = 0; // No hands in FREE PLAY
player->karthud[khud_lapanimation] = 80;
}
}
// finished race exit setup