mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Get distance to first by using the distanceofinish variable for roulette
This commit is contained in:
parent
6bcc283d3b
commit
991cef9163
1 changed files with 6 additions and 7 deletions
13
src/k_kart.c
13
src/k_kart.c
|
|
@ -1088,13 +1088,12 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
|
|||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i] && !players[i].spectator && players[i].mo
|
||||
&& players[i].kartstuff[k_position] < player->kartstuff[k_position])
|
||||
pdis += P_AproxDistance(P_AproxDistance(players[i].mo->x - player->mo->x,
|
||||
players[i].mo->y - player->mo->y),
|
||||
players[i].mo->z - player->mo->z) / mapobjectscale
|
||||
* (pingame - players[i].kartstuff[k_position])
|
||||
/ max(1, ((pingame - 1) * (pingame + 1) / 3));
|
||||
if (players[i].kartstuff[k_position] == 1)
|
||||
{
|
||||
// This player is first! Yay!
|
||||
pdis = player->distancetofinish - players[i].distancetofinish;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (franticitems) // Frantic items make the distances between everyone artifically higher, for crazier items
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue