mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-03-26 21:11:51 +00:00
Tutorial Skip: clear bots so Eggman bot does not carry over from Tutorial
This commit is contained in:
parent
d366e9bb11
commit
5561928ad4
1 changed files with 22 additions and 11 deletions
|
|
@ -319,6 +319,27 @@ void K_UpdateMatchRaceBots(void)
|
|||
}
|
||||
}
|
||||
|
||||
auto clear_bots = [&numbots](UINT8 max)
|
||||
{
|
||||
UINT8 i = MAXPLAYERS;
|
||||
while (numbots > max && i > 0)
|
||||
{
|
||||
i--;
|
||||
|
||||
if (playeringame[i] && players[i].bot)
|
||||
{
|
||||
CL_RemovePlayer(i, KR_LEAVE);
|
||||
numbots--;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (tutorialchallenge == TUTORIALSKIP_INPROGRESS)
|
||||
{
|
||||
// Prevent Eggman bot carrying over from Tutorial
|
||||
clear_bots(0);
|
||||
}
|
||||
|
||||
if (numbots < wantedbots)
|
||||
{
|
||||
// We require MORE bots!
|
||||
|
|
@ -372,17 +393,7 @@ void K_UpdateMatchRaceBots(void)
|
|||
}
|
||||
else if (numbots > wantedbots)
|
||||
{
|
||||
i = MAXPLAYERS;
|
||||
while (numbots > wantedbots && i > 0)
|
||||
{
|
||||
i--;
|
||||
|
||||
if (playeringame[i] && players[i].bot)
|
||||
{
|
||||
CL_RemovePlayer(i, KR_LEAVE);
|
||||
numbots--;
|
||||
}
|
||||
}
|
||||
clear_bots(wantedbots);
|
||||
}
|
||||
|
||||
// We should have enough bots now :)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue