mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Adjust bot rubberbanding distance with game speed
This commit is contained in:
parent
e2d95ae9c1
commit
2282fa7452
1 changed files with 9 additions and 5 deletions
14
src/k_bot.c
14
src/k_bot.c
|
|
@ -219,8 +219,9 @@ boolean K_BotCanTakeCut(player_t *player)
|
||||||
|
|
||||||
static UINT32 K_BotRubberbandDistance(player_t *player)
|
static UINT32 K_BotRubberbandDistance(player_t *player)
|
||||||
{
|
{
|
||||||
const UINT32 spacing = 2048;
|
const UINT32 spacing = 1024;
|
||||||
const UINT8 portpriority = player - players;
|
const UINT8 portpriority = player - players;
|
||||||
|
UINT32 dist = 0;
|
||||||
UINT8 pos = 0;
|
UINT8 pos = 0;
|
||||||
UINT8 i;
|
UINT8 i;
|
||||||
|
|
||||||
|
|
@ -236,20 +237,23 @@ static UINT32 K_BotRubberbandDistance(player_t *player)
|
||||||
// First check difficulty levels, then score, then settle it with port priority!
|
// First check difficulty levels, then score, then settle it with port priority!
|
||||||
if (player->botvars.difficulty < players[i].botvars.difficulty)
|
if (player->botvars.difficulty < players[i].botvars.difficulty)
|
||||||
{
|
{
|
||||||
pos++;
|
pos += 3;
|
||||||
}
|
}
|
||||||
else if (player->score < players[i].score)
|
else if (player->score < players[i].score)
|
||||||
{
|
{
|
||||||
pos++;
|
pos += 2;
|
||||||
}
|
}
|
||||||
else if (i < portpriority)
|
else if (i < portpriority)
|
||||||
{
|
{
|
||||||
pos++;
|
pos += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (pos * spacing);
|
dist = (pos * spacing);
|
||||||
|
dist = FixedDiv(dist * FRACUNIT, K_GetKartGameSpeedScalar(gamespeed)) / FRACUNIT;
|
||||||
|
|
||||||
|
return dist;
|
||||||
}
|
}
|
||||||
|
|
||||||
fixed_t K_BotRubberband(player_t *player)
|
fixed_t K_BotRubberband(player_t *player)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue