mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
WIP
This commit is contained in:
parent
ef627afcf3
commit
7e9710e81a
2 changed files with 24 additions and 13 deletions
17
src/k_kart.c
17
src/k_kart.c
|
|
@ -297,7 +297,7 @@ void K_TimerInit(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (K_InRaceDuel())
|
if (K_InRaceDuel())
|
||||||
numlaps = 200;
|
numlaps = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -10764,6 +10764,13 @@ static void K_UpdateDistanceFromFinishLine(player_t *const player)
|
||||||
}
|
}
|
||||||
Z_Free(pathtofinish.array);
|
Z_Free(pathtofinish.array);
|
||||||
|
|
||||||
|
if (K_InRaceDuel() && player->position == 1)
|
||||||
|
{
|
||||||
|
// As far as we're concerned, the race starts and ends with our position.
|
||||||
|
// Don't care about laps at all!
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// distancetofinish is currently a flat distance to the finish line, but in order to be fully
|
// distancetofinish is currently a flat distance to the finish line, but in order to be fully
|
||||||
// correct we need to add to it the length of the entire circuit multiplied by the number of laps
|
// correct we need to add to it the length of the entire circuit multiplied by the number of laps
|
||||||
// left after this one. This will give us the total distance to the finish line, and allow item
|
// left after this one. This will give us the total distance to the finish line, and allow item
|
||||||
|
|
@ -10771,12 +10778,18 @@ static void K_UpdateDistanceFromFinishLine(player_t *const player)
|
||||||
const mapheader_t *mapheader = mapheaderinfo[gamemap - 1];
|
const mapheader_t *mapheader = mapheaderinfo[gamemap - 1];
|
||||||
if ((mapheader->levelflags & LF_SECTIONRACE) == 0U)
|
if ((mapheader->levelflags & LF_SECTIONRACE) == 0U)
|
||||||
{
|
{
|
||||||
const UINT8 numfulllapsleft = ((UINT8)numlaps - player->laps) / mapheader->lapspersection;
|
UINT8 numfulllapsleft = ((UINT8)numlaps - player->laps) / mapheader->lapspersection;
|
||||||
|
if (K_InRaceDuel())
|
||||||
|
{
|
||||||
|
player_t *opp = K_DuelOpponent(player);
|
||||||
|
numfulllapsleft = opp->laps - player->laps;
|
||||||
|
}
|
||||||
player->distancetofinish += numfulllapsleft * K_GetCircuitLength();
|
player->distancetofinish += numfulllapsleft * K_GetCircuitLength();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT32 u32_delta(UINT32 x, UINT32 y)
|
static UINT32 u32_delta(UINT32 x, UINT32 y)
|
||||||
|
|
|
||||||
|
|
@ -1992,10 +1992,8 @@ static void K_HandleLapIncrement(player_t *player)
|
||||||
player->latestlap = player->laps;
|
player->latestlap = player->laps;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean specialduelexit = (inDuel && !(mapheaderinfo[gamemap-1]->levelflags & LF_SECTIONRACE));
|
|
||||||
|
|
||||||
// finished race exit setup
|
// finished race exit setup
|
||||||
if (player->laps > numlaps && !specialduelexit)
|
if (player->laps > numlaps && !K_InRaceDuel())
|
||||||
{
|
{
|
||||||
pflags_t applyflags = 0;
|
pflags_t applyflags = 0;
|
||||||
if (specialstageinfo.valid == true)
|
if (specialstageinfo.valid == true)
|
||||||
|
|
@ -2021,7 +2019,7 @@ static void K_HandleLapIncrement(player_t *player)
|
||||||
: skins[player->skin].flags;
|
: skins[player->skin].flags;
|
||||||
if (skinflags & SF_IRONMAN)
|
if (skinflags & SF_IRONMAN)
|
||||||
{
|
{
|
||||||
if (!K_InRaceDuel()) // We'll do this in K_CheckpointCrossAward if necessary.
|
if ((player->laps == 1 && lapisfresh) || !K_InRaceDuel()) // We'll do this in K_CheckpointCrossAward if necessary.
|
||||||
SetRandomFakePlayerSkin(player, true, false);
|
SetRandomFakePlayerSkin(player, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue