Don't spew "not recording a demo" when changing maps with a qtv

Just because recorders exist doesn't mean a demo is being recorded: add a flag
for such.
This commit is contained in:
Bill Currie 2010-01-13 06:44:29 +00:00 committed by Jeff Teunissen
parent 907efe03a4
commit b61a336d8a
4 changed files with 8 additions and 2 deletions

View file

@ -112,6 +112,7 @@ typedef struct {
byte signon_buffers[MAX_SIGNON_BUFFERS][MAX_DATAGRAM];
// demo stuff
int recording_demo;
struct recorder_s *recorders;
} server_t;

View file

@ -462,7 +462,7 @@ SV_Map_f (void)
Qclose (f);
free (expanded);
if (sv.recorders)
if (sv.recording_demo)
SV_Stop (0);
SV_BroadcastCommand ("changing\n");

View file

@ -139,6 +139,7 @@ demo_finish (void *unused, sizebuf_t *msg)
MSG_WriteByte (msg, svc_disconnect);
MSG_WriteString (msg, "EndOfDemo");
recorder = 0;
sv.recording_demo = 0;
}
/*
@ -164,6 +165,8 @@ SV_Stop (int reason)
demo_file = NULL;
SVR_RemoveUser (recorder);
recorder = 0;
sv.recording_demo = 0;
SV_BroadcastPrintf (PRINT_CHAT,
"Server recording canceled, demo removed\n");
@ -180,6 +183,7 @@ SV_Stop (int reason)
Qclose (demo_file);
demo_file = NULL;
recorder = 0;
sv.recording_demo = 0;
if (!reason)
SV_BroadcastPrintf (PRINT_CHAT, "Server recording completed\n");
else
@ -417,6 +421,7 @@ SV_Record (char *name)
recorder = SVR_AddUser (demo_write, demo_frame, demo_end_frame,
demo_finish, 1, 0);
sv.recording_demo = 1;
delta_sequence = -1;
demo_time = sv.time;

View file

@ -248,7 +248,7 @@ SV_Shutdown (void)
Qclose (sv_fraglogfile);
sv_fraglogfile = NULL;
}
if (sv.recorders)
if (sv.recording_demo)
SV_Stop (0);
NET_Shutdown ();