Fix #165 by not ignoring the track specified in the NQ demo header

This commit is contained in:
Marco Cawthorne 2023-06-24 17:42:11 -07:00
parent a05c722cbd
commit 6692afa55b
Signed by: eukara
GPG key ID: CE2032F0A2882A22
4 changed files with 12 additions and 0 deletions

View file

@ -77,6 +77,7 @@ void CL_StopPlayback (void)
cls.state = ca_disconnected;
cls.demoplayback = DPB_NONE;
cls.demoseeking = false; //just in case
cls.demotrack = -1;
if (cls.timedemo)
CL_FinishTimeDemo ();
@ -2415,6 +2416,11 @@ void CL_PlayDemoFile(vfsfile_t *f, char *demoname, qboolean issyspath)
ft *= -1;
if (chr == '\n')
{
if (ft > 0)
cls.demotrack = ft;
else
cls.demotrack = -1;
CL_PlayDemoStream(f, demoname, issyspath, DPB_NETQUAKE, 0);
return;
}

View file

@ -5135,6 +5135,7 @@ void CL_Init (void)
size_t seat;
cls.state = ca_disconnected;
cls.demotrack = -1;
#ifdef SVNREVISION
if (strcmp(STRINGIFY(SVNREVISION), "-"))

View file

@ -8405,6 +8405,10 @@ void CLNQ_ParseServerMessage (void)
unsigned int looptrack;
firsttrack = MSG_ReadByte ();
looptrack = MSG_ReadByte ();
if (cls.demotrack != -1)
firsttrack = looptrack = cls.demotrack;
Media_NumberedTrack (firsttrack, looptrack);
}
break;

View file

@ -518,6 +518,7 @@ typedef struct
qboolean demohadkeyframe; //q2 needs to wait for a packet with a key frame, supposedly.
qboolean demoseeking;
float demoseektime;
int demotrack;
qboolean timedemo;
char lastdemoname[MAX_OSPATH];
qboolean lastdemowassystempath;