This commit is contained in:
toaster 2025-09-18 20:49:06 +01:00
parent 20c1695ae4
commit 7e7e07dbd3

View file

@ -682,50 +682,54 @@ void K_IncreaseBotDifficulty(player_t *bot)
totalRank += human->tally.rank; totalRank += human->tally.rank;
} }
SINT8 averageRank = totalRank / humanPlayers; if (humanPlayers)
switch(averageRank)
{ {
case GRADE_E: SINT8 averageRank = totalRank / humanPlayers;
case GRADE_D:
case GRADE_C:
rankNudge = -1;
break;
case GRADE_B:
rankNudge = 0;
break;
case GRADE_A:
rankNudge = 1;
break;
}
// RELAXED MODE: // RELAXED MODE:
// Continues don't drop bot difficulty, because we always advance. // Continues don't drop bot difficulty, because we always advance.
// Bots will still level up from standard advancement; we need a // Bots will still level up from standard advancement; we need a
// much steeper rank nudge to keep difficulty at the right level. // much steeper rank nudge to keep difficulty at the right level.
if (grandprixinfo.gamespeed == KARTSPEED_EASY) if (grandprixinfo.gamespeed == KARTSPEED_EASY)
{
switch(averageRank)
{ {
case GRADE_E: switch (averageRank)
rankNudge = -4; {
break; case GRADE_E:
case GRADE_D: rankNudge = -4;
rankNudge = -2; break;
break; case GRADE_D:
case GRADE_C: rankNudge = -2;
rankNudge = -1; break;
break; case GRADE_C:
case GRADE_B: rankNudge = -1;
rankNudge = 0; break;
break; case GRADE_B:
case GRADE_A: rankNudge = 0;
rankNudge = 1; break;
break; case GRADE_A:
rankNudge = 1;
break;
}
}
else
{
switch (averageRank)
{
case GRADE_E:
case GRADE_D:
case GRADE_C:
rankNudge = -1;
break;
case GRADE_B:
rankNudge = 0;
break;
case GRADE_A:
rankNudge = 1;
break;
}
} }
} }
increase += rankNudge; increase += rankNudge;
if (increase <= 0) if (increase <= 0)