summaryrefslogtreecommitdiff
path: root/source/mvd_client.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-09-28 18:03:56 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-09-28 18:03:56 +0000
commitcbe71bc9831ea939c86dae6a6ebbd92bdebf8fbf (patch)
tree42bb9a8aee2310bb2e9fbd3ebeae315603e1c004 /source/mvd_client.c
parentb952a73bd5087e2b2e25a143c58c1f1d25e7cd3a (diff)
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.
Diffstat (limited to 'source/mvd_client.c')
-rw-r--r--source/mvd_client.c19
1 files changed, 13 insertions, 6 deletions
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();
}