From 3802f61dc111c1ccdbf36befbf063adb841156ca Mon Sep 17 00:00:00 2001 From: Skirlez Date: Sat, 4 Oct 2025 23:14:22 +0300 Subject: [PATCH] Don't spectate player with shuffleloser on if the other player spectated --- src/k_grandprix.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/k_grandprix.cpp b/src/k_grandprix.cpp index 7891306b2..f994f786c 100644 --- a/src/k_grandprix.cpp +++ b/src/k_grandprix.cpp @@ -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.