From 02f3664b2e01591864b1d4022a8d7ddf10787f33 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Mon, 10 Sep 2012 01:22:13 +0000 Subject: [PATCH] Fix game getting stuck in a do-while loop when "team follow1" or "team follow2" client sends a follownext or followprev command. --- code/game/g_cmds.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/game/g_cmds.c b/code/game/g_cmds.c index 518657a3..62364408 100644 --- a/code/game/g_cmds.c +++ b/code/game/g_cmds.c @@ -749,6 +749,16 @@ void Cmd_FollowCycle_f( gentity_t *ent, int dir ) { G_Error( "Cmd_FollowCycle_f: bad dir %i", dir ); } + // if dedicated follow client, just switch between the two auto clients + if (ent->client->sess.spectatorClient < 0) { + if (ent->client->sess.spectatorClient == -1) { + ent->client->sess.spectatorClient = -2; + } else if (ent->client->sess.spectatorClient == -2) { + ent->client->sess.spectatorClient = -1; + } + return; + } + clientnum = ent->client->sess.spectatorClient; original = clientnum; do {