Revision | 6cf21780385b322c773ccffd39684df709a18de1 (tree) |
---|---|
Time | 2022-02-19 00:06:35 |
Author | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Removed a minor code duplication with restoring a demo's recording status during level changes.
@@ -1397,17 +1397,12 @@ | ||
1397 | 1397 | // [BB] Setting the game mode is necessary to decide whether 3D floors should be spawned or not. |
1398 | 1398 | GAMEMODE_SetCurrentMode ( static_cast<GAMEMODE_e>(pByteStream->ReadByte()) ); |
1399 | 1399 | |
1400 | - bool bPlaying; | |
1401 | - | |
1402 | 1400 | // Print a status message. |
1403 | 1401 | Printf( "Level authenticated!\n" ); |
1404 | 1402 | |
1405 | 1403 | // Check to see if we have the map. |
1406 | 1404 | if ( P_CheckIfMapExists( g_szMapName )) |
1407 | 1405 | { |
1408 | - // Save our demo recording status since G_InitNew resets it. | |
1409 | - bPlaying = CLIENTDEMO_IsPlaying( ); | |
1410 | - | |
1411 | 1406 | // Start new level. |
1412 | 1407 | G_InitNew( g_szMapName, false ); |
1413 | 1408 |
@@ -1418,9 +1413,6 @@ | ||
1418 | 1413 | viewactive = false; |
1419 | 1414 | |
1420 | 1415 | g_ulLastConsolePlayerUpdateTick = 0; |
1421 | - | |
1422 | - // Restore our demo recording status. | |
1423 | - CLIENTDEMO_SetPlaying( bPlaying ); | |
1424 | 1416 | } |
1425 | 1417 | // [BB] If we don't have the map, something went horribly wrong. |
1426 | 1418 | else |
@@ -6986,9 +6978,6 @@ | ||
6986 | 6978 | // Check to see if we have the map. |
6987 | 6979 | if ( P_CheckIfMapExists( mapName )) |
6988 | 6980 | { |
6989 | - // Save our demo recording status since G_InitNew resets it. | |
6990 | - bool playing = CLIENTDEMO_IsPlaying( ); | |
6991 | - | |
6992 | 6981 | // Start new level. |
6993 | 6982 | G_InitNew( mapName, false ); |
6994 | 6983 |
@@ -6999,9 +6988,6 @@ | ||
6999 | 6988 | // [BB] We'll receive a full update for the new map from the server. |
7000 | 6989 | g_bFullUpdateIncomplete = true; |
7001 | 6990 | |
7002 | - // Restore our demo recording status. | |
7003 | - CLIENTDEMO_SetPlaying( playing ); | |
7004 | - | |
7005 | 6991 | // [BB] viewactive is set in G_InitNew |
7006 | 6992 | // For right now, the view is not active. |
7007 | 6993 | //viewactive = false; |
@@ -381,8 +381,11 @@ | ||
381 | 381 | |
382 | 382 | G_ClearHubInfo(); |
383 | 383 | |
384 | + // [AK] We must save our demo playback status since G_InitNew resets it. | |
385 | + const bool bIsPlayingDemo = CLIENTDEMO_IsPlaying( ); | |
386 | + | |
384 | 387 | // [BB] If there is a free spectator player from the last map, be sure to get rid of it. |
385 | - if ( CLIENTDEMO_IsPlaying() ) | |
388 | + if ( bIsPlayingDemo ) | |
386 | 389 | CLIENTDEMO_ClearFreeSpectatorPlayer(); |
387 | 390 | |
388 | 391 | // [BC] Clients need to keep their snapshots around for hub purposes, and since |
@@ -584,6 +587,12 @@ | ||
584 | 587 | // [BB] Somehow G_DoLoadLevel alters the contents of mapname. This causes the "Frags" bug. |
585 | 588 | G_DoLoadLevel (0, false); |
586 | 589 | |
590 | + // [AK] Restore our demo playback status. | |
591 | + if ( bIsPlayingDemo ) | |
592 | + { | |
593 | + CLIENTDEMO_SetPlaying( true ); | |
594 | + } | |
595 | + | |
587 | 596 | // if ( NETWORK_GetState( ) == NETSTATE_SERVER ) |
588 | 597 | // SERVERCONSOLE_SetupColumns( ); |
589 | 598 | } |