• R/O
  • SSH

zandronum-sandbox-stable: Commit


Commit MetaInfo

Revision6cf21780385b322c773ccffd39684df709a18de1 (tree)
Time2022-02-19 00:06:35
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Removed a minor code duplication with restoring a demo's recording status during level changes.

Change Summary

Incremental Difference

diff -r 7e1f112cea14 -r 6cf21780385b src/cl_main.cpp
--- a/src/cl_main.cpp Sun Feb 20 05:05:41 2022 +0000
+++ b/src/cl_main.cpp Fri Feb 18 10:06:35 2022 -0500
@@ -1397,17 +1397,12 @@
13971397 // [BB] Setting the game mode is necessary to decide whether 3D floors should be spawned or not.
13981398 GAMEMODE_SetCurrentMode ( static_cast<GAMEMODE_e>(pByteStream->ReadByte()) );
13991399
1400- bool bPlaying;
1401-
14021400 // Print a status message.
14031401 Printf( "Level authenticated!\n" );
14041402
14051403 // Check to see if we have the map.
14061404 if ( P_CheckIfMapExists( g_szMapName ))
14071405 {
1408- // Save our demo recording status since G_InitNew resets it.
1409- bPlaying = CLIENTDEMO_IsPlaying( );
1410-
14111406 // Start new level.
14121407 G_InitNew( g_szMapName, false );
14131408
@@ -1418,9 +1413,6 @@
14181413 viewactive = false;
14191414
14201415 g_ulLastConsolePlayerUpdateTick = 0;
1421-
1422- // Restore our demo recording status.
1423- CLIENTDEMO_SetPlaying( bPlaying );
14241416 }
14251417 // [BB] If we don't have the map, something went horribly wrong.
14261418 else
@@ -6986,9 +6978,6 @@
69866978 // Check to see if we have the map.
69876979 if ( P_CheckIfMapExists( mapName ))
69886980 {
6989- // Save our demo recording status since G_InitNew resets it.
6990- bool playing = CLIENTDEMO_IsPlaying( );
6991-
69926981 // Start new level.
69936982 G_InitNew( mapName, false );
69946983
@@ -6999,9 +6988,6 @@
69996988 // [BB] We'll receive a full update for the new map from the server.
70006989 g_bFullUpdateIncomplete = true;
70016990
7002- // Restore our demo recording status.
7003- CLIENTDEMO_SetPlaying( playing );
7004-
70056991 // [BB] viewactive is set in G_InitNew
70066992 // For right now, the view is not active.
70076993 //viewactive = false;
diff -r 7e1f112cea14 -r 6cf21780385b src/g_level.cpp
--- a/src/g_level.cpp Sun Feb 20 05:05:41 2022 +0000
+++ b/src/g_level.cpp Fri Feb 18 10:06:35 2022 -0500
@@ -381,8 +381,11 @@
381381
382382 G_ClearHubInfo();
383383
384+ // [AK] We must save our demo playback status since G_InitNew resets it.
385+ const bool bIsPlayingDemo = CLIENTDEMO_IsPlaying( );
386+
384387 // [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 )
386389 CLIENTDEMO_ClearFreeSpectatorPlayer();
387390
388391 // [BC] Clients need to keep their snapshots around for hub purposes, and since
@@ -584,6 +587,12 @@
584587 // [BB] Somehow G_DoLoadLevel alters the contents of mapname. This causes the "Frags" bug.
585588 G_DoLoadLevel (0, false);
586589
590+ // [AK] Restore our demo playback status.
591+ if ( bIsPlayingDemo )
592+ {
593+ CLIENTDEMO_SetPlaying( true );
594+ }
595+
587596 // if ( NETWORK_GetState( ) == NETSTATE_SERVER )
588597 // SERVERCONSOLE_SetupColumns( );
589598 }
Show on old repository browser