From cbe71bc9831ea939c86dae6a6ebbd92bdebf8fbf Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Sun, 28 Sep 2008 18:03:56 +0000 Subject: Made MVD observers switch to the previous chase target during map change after the intermission. Ensure end-of-match scoreboard and MVD client list are reliably delivered. Properly reset cursor position when switching between layouts. --- source/mvd_client.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'source/mvd_client.c') diff --git a/source/mvd_client.c b/source/mvd_client.c index 5c7570c..16cec3e 100644 --- a/source/mvd_client.c +++ b/source/mvd_client.c @@ -201,7 +201,7 @@ void MVD_ClearState( mvd_t *mvd ) { mvd->layout[0] = 0; mvd->framenum = 0; - mvd->intermission = qfalse; + //mvd->intermission = qfalse; } void MVD_BeginWaiting( mvd_t *mvd ) { @@ -458,7 +458,7 @@ void MVD_GetStream( const char *uri ) { } void MVD_ChangeLevel( mvd_t *mvd ) { - udpClient_t *u; + udpClient_t *client; if( sv.state != ss_broadcast ) { MVD_Spawn_f(); // the game is just starting @@ -469,14 +469,21 @@ void MVD_ChangeLevel( mvd_t *mvd ) { MSG_WriteByte( svc_stufftext ); MSG_WriteString( va( "changing map=%s; reconnect\n", mvd->mapname ) ); - LIST_FOR_EACH( udpClient_t, u, &mvd->udpClients, entry ) { - SV_ClientReset( u->cl ); - u->cl->spawncount = mvd->servercount; - SV_ClientAddMessage( u->cl, MSG_RELIABLE ); + LIST_FOR_EACH( udpClient_t, client, &mvd->udpClients, entry ) { + if( mvd->intermission && client->cl->state == cs_spawned ) { + // make them switch to previous target instead of MVD dummy + client->target = client->oldtarget; + client->oldtarget = NULL; + } + SV_ClientReset( client->cl ); + client->cl->spawncount = mvd->servercount; + SV_ClientAddMessage( client->cl, MSG_RELIABLE ); } SZ_Clear( &msg_write ); + mvd->intermission = qfalse; + SV_SendAsyncPackets(); } -- cgit v1.2.3