Commit MetaInfo

Revision2195e2f1ae58f82a5a43fa02c4af286d886db496 (tree)
Time2021-10-08 00:10:21
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Fixed a player respawning with no weapon selected if the level changed while they were dead.

Change Summary

Incremental Difference

diff -r b5baa0b72f77 -r 2195e2f1ae58 src/g_level.cpp
--- a/src/g_level.cpp Sat Oct 09 17:15:44 2021 -0400
+++ b/src/g_level.cpp Thu Oct 07 11:10:21 2021 -0400
@@ -1358,7 +1358,7 @@
13581358 if ( NETWORK_GetState( ) == NETSTATE_SERVER )
13591359 {
13601360 // [AK] Reset this client's tic buffer.
1361- SERVER_ResetClientTicBuffer( i );
1361+ SERVER_ResetClientTicBuffer( i, false );
13621362
13631363 SERVERCONSOLE_UpdatePlayerInfo( i, UDF_FRAGS|UDF_PING|UDF_TIME );
13641364 // [BB] Since the map was changed, the players who are already spawned need to reauthenticate.
diff -r b5baa0b72f77 -r 2195e2f1ae58 src/gamemode.cpp
--- a/src/gamemode.cpp Sat Oct 09 17:15:44 2021 -0400
+++ b/src/gamemode.cpp Thu Oct 07 11:10:21 2021 -0400
@@ -785,7 +785,7 @@
785785 {
786786 // [AK] If we're the server, reset the client's tic buffer every time they spawn.
787787 if (( NETWORK_GetState( ) == NETSTATE_SERVER ) && ( players[ulPlayer].bSpectating == false ))
788- SERVER_ResetClientTicBuffer( ulPlayer );
788+ SERVER_ResetClientTicBuffer( ulPlayer, false );
789789
790790 // Spawn the player at their appropriate team start.
791791 if ( GAMEMODE_GetCurrentFlags() & GMF_TEAMGAME )
diff -r b5baa0b72f77 -r 2195e2f1ae58 src/sv_main.cpp
--- a/src/sv_main.cpp Sat Oct 09 17:15:44 2021 -0400
+++ b/src/sv_main.cpp Thu Oct 07 11:10:21 2021 -0400
@@ -5261,13 +5261,16 @@
52615261
52625262 //*****************************************************************************
52635263 //
5264-void SERVER_ResetClientTicBuffer( ULONG ulClient )
5264+void SERVER_ResetClientTicBuffer( ULONG ulClient, bool bClearMoveCMDs )
52655265 {
52665266 // [AK] Clear all stored commands in the tic buffer.
5267- for ( unsigned int i = 0; i < g_aClients[ulClient].MoveCMDs.Size( ); i++ )
5268- delete g_aClients[ulClient].MoveCMDs[i];
5269-
5270- g_aClients[ulClient].MoveCMDs.Clear( );
5267+ if ( bClearMoveCMDs )
5268+ {
5269+ for ( unsigned int i = 0; i < g_aClients[ulClient].MoveCMDs.Size( ); i++ )
5270+ delete g_aClients[ulClient].MoveCMDs[i];
5271+
5272+ g_aClients[ulClient].MoveCMDs.Clear( );
5273+ }
52715274
52725275 // [AK] Also delete the last processed movement command.
52735276 if ( g_aClients[ulClient].LastMoveCMD != NULL )
diff -r b5baa0b72f77 -r 2195e2f1ae58 src/sv_main.h
--- a/src/sv_main.h Sat Oct 09 17:15:44 2021 -0400
+++ b/src/sv_main.h Thu Oct 07 11:10:21 2021 -0400
@@ -598,7 +598,7 @@
598598 void STACK_ARGS SERVER_PrintWarning( const char* format, ... ) GCCPRINTF( 1, 2 );
599599 void SERVER_FlagsetChanged( FIntCVar& flagset, int maxflags = 2 );
600600 bool SERVER_ShouldAcceptBacktraceResult( ULONG ulClient, MOVE_THING_DATA_s OldData );
601-void SERVER_ResetClientTicBuffer( ULONG ulClient );
601+void SERVER_ResetClientTicBuffer( ULONG ulClient, bool bClearMoveCMDs = true );
602602 void SERVER_ResetClientExtrapolation( ULONG ulClient );
603603
604604 // From sv_master.cpp
Show on old repository browser