]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix bots occasionally getting stuck when one of them disconnects
authorterencehill <piuntn@gmail.com>
Tue, 28 Feb 2017 15:16:31 +0000 (16:16 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 28 Feb 2017 15:16:31 +0000 (16:16 +0100)
qcsrc/server/bot/default/bot.qc

index 318422153bb3423478e9f8dc980a0fea24daf5e4..c598473903fb60b46720ef437b617c339302a65c 100644 (file)
@@ -374,14 +374,13 @@ void bot_relinkplayerlist()
                        if(prevbot)
                                prevbot.nextbot = it;
                        else
-                       {
                                bot_list = it;
-                               bot_list.nextbot = NULL;
-                       }
                        prevbot = it;
                        ++currentbots;
                }
        });
+       if(prevbot)
+               prevbot.nextbot = NULL;
        LOG_TRACE("relink: ", ftos(currentbots), " bots seen.");
        bot_strategytoken = bot_list;
        bot_strategytoken_taken = true;