mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Update spawn positions in Race to use power levels
This commit is contained in:
parent
ea2bcb3b99
commit
e1d5233dba
1 changed files with 30 additions and 3 deletions
33
src/g_game.c
33
src/g_game.c
|
|
@ -2839,11 +2839,16 @@ mapthing_t *G_FindRaceStart(INT32 playernum)
|
||||||
{
|
{
|
||||||
UINT8 i;
|
UINT8 i;
|
||||||
UINT8 pos = 0;
|
UINT8 pos = 0;
|
||||||
|
boolean usepowerlvl = false;
|
||||||
|
|
||||||
// SRB2Kart: figure out player spawn pos from points
|
// SRB2Kart: figure out player spawn pos from points
|
||||||
if (!playeringame[playernum] || players[playernum].spectator)
|
if (!playeringame[playernum] || players[playernum].spectator)
|
||||||
return playerstarts[0]; // go to first spot if you're a spectator
|
return playerstarts[0]; // go to first spot if you're a spectator
|
||||||
|
|
||||||
|
// Setup power level type
|
||||||
|
if (netgame)
|
||||||
|
usepowerlvl = true;
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if (!playeringame[i] || players[i].spectator)
|
if (!playeringame[i] || players[i].spectator)
|
||||||
|
|
@ -2864,8 +2869,17 @@ mapthing_t *G_FindRaceStart(INT32 playernum)
|
||||||
continue;
|
continue;
|
||||||
if (j == i)
|
if (j == i)
|
||||||
continue;
|
continue;
|
||||||
if (players[j].score == players[i].score)
|
|
||||||
num++;
|
if (usepowerlvl)
|
||||||
|
{
|
||||||
|
if (clientpowerlevels[j][0] == clientpowerlevels[i][0])
|
||||||
|
num++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (players[j].score == players[i].score)
|
||||||
|
num++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (num > 1) // found dupes
|
if (num > 1) // found dupes
|
||||||
|
|
@ -2873,8 +2887,21 @@ mapthing_t *G_FindRaceStart(INT32 playernum)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (players[i].score > players[playernum].score || i < playernum)
|
if (i < playernum)
|
||||||
pos++;
|
pos++;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (usepowerlvl)
|
||||||
|
{
|
||||||
|
if (clientpowerlevels[i][0] > clientpowerlevels[playernum][0])
|
||||||
|
pos++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (players[i].score > players[playernum].score)
|
||||||
|
pos++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue