Merge branch 'fix-shuffleloser-spec' into 'master'

Don't spectate player with shuffleloser on if a player spectated mid-race

Closes #310

See merge request kart-krew-dev/ring-racers!52
This commit is contained in:
Eidolon 2025-10-06 14:49:35 -05:00
commit 6b95e3e218

View file

@ -858,7 +858,12 @@ void K_RetireBots(void)
std::stable_sort(humans.begin(), humans.end(), CompareReplacements);
std::stable_sort(bots.begin(), bots.end(), CompareReplacements);
if (G_GametypeHasSpectators() == true && grandprixinfo.gp == false && cv_shuffleloser.value != 0)
// If a player spectated mid-race or mid-duel, they will be placed in-game by K_CheckSpectateStatus,
// and their position will be set to 0. Since we're only replacing one player as of now, there's no need
// to do anything; a player has already been replaced.
bool player_already_joined = (!humans.empty() && humans[0]->position == 0);
if (G_GametypeHasSpectators() == true && grandprixinfo.gp == false && !player_already_joined && cv_shuffleloser.value != 0)
{
// While joiners and players still exist, insert joiners.