Skip to content

Commit eb8d069

Browse files
committed
Make sure to call SCR_FinishCinematic() only once to avoid lockups when input queue is full.
1 parent 6f635af commit eb8d069

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

client/cl_cin.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ typedef struct
4646
} cinematics_t;
4747

4848
cinematics_t cin;
49+
qboolean cin_finished = false;
4950

5051
/*
5152
=================================================================
@@ -197,6 +198,13 @@ Called when either the cinematic completes, or it is aborted
197198
*/
198199
void SCR_FinishCinematic (void)
199200
{
201+
// For expansions packs/mods with multiple cinematics played in a row, the input queue
202+
// may cause the "nextserver" message to be sent out more than once which results in a lockup.
203+
// Here we make sure that SCR_FinishCinematic() is called exactly once to avoid this.
204+
if (cin_finished)
205+
return;
206+
207+
cin_finished = true;
200208
// tell the server to advance to the next map / cinematic
201209
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
202210
SZ_Print (&cls.netchan.message, va("nextserver %i\n", cl.servercount));
@@ -584,6 +592,7 @@ void SCR_PlayCinematic (char *arg)
584592
CDAudio_Stop();
585593
Miniaudio_Stop();
586594

595+
cin_finished = false;
587596
cl.cinematicframe = 0;
588597
dot = strstr (arg, ".");
589598
if (dot && !strcmp (dot, ".pcx"))

0 commit comments

Comments
 (0)