• R/O
  • SSH

zandronum-sandbox-stable: Commit


Commit MetaInfo

Revision9f82c6b88d99e1ae1b2431330370635bfe39e3f8 (tree)
Time2023-03-28 11:51:43
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Renamed SCOREBOARD_ResetCustomColumnsForPlayer to PLAYER_ResetCustomValues, and moved it to "p_interaction.cpp".

Change Summary

Incremental Difference

diff -r 9a47035d9a7a -r 9f82c6b88d99 src/bots.cpp
--- a/src/bots.cpp Sun Mar 26 23:52:29 2023 -0400
+++ b/src/bots.cpp Mon Mar 27 22:51:43 2023 -0400
@@ -597,8 +597,8 @@
597597 // [AK] Clear all the saved chat messages this bot said.
598598 CHAT_ClearChatMessages( ulPlayerIdx );
599599
600- // [AK] Reset this player's custom columns to their default values.
601- SCOREBOARD_ResetCustomColumnsForPlayer( ulPlayerIdx );
600+ // [AK] Reset this player's custom values to their default values.
601+ PLAYER_ResetCustomValues( ulPlayerIdx );
602602
603603 // [BB] Morphed bots need to be unmorphed before disconnecting.
604604 if (players[ulPlayerIdx].morphTics)
diff -r 9a47035d9a7a -r 9f82c6b88d99 src/cl_main.cpp
--- a/src/cl_main.cpp Sun Mar 26 23:52:29 2023 -0400
+++ b/src/cl_main.cpp Mon Mar 27 22:51:43 2023 -0400
@@ -4544,8 +4544,8 @@
45444544 // [AK] Clear all the saved chat messages this player said.
45454545 CHAT_ClearChatMessages( player - players );
45464546
4547- // [AK] Reset this player's custom columns to their default values.
4548- SCOREBOARD_ResetCustomColumnsForPlayer( player - players );
4547+ // [AK] Reset this player's custom values to their default values.
4548+ PLAYER_ResetCustomValues( player - players );
45494549
45504550 // Zero out all the player information.
45514551 PLAYER_ResetPlayerData( player );
diff -r 9a47035d9a7a -r 9f82c6b88d99 src/d_player.h
--- a/src/d_player.h Sun Mar 26 23:52:29 2023 -0400
+++ b/src/d_player.h Mon Mar 27 22:51:43 2023 -0400
@@ -833,6 +833,7 @@
833833 LONG PLAYER_CalcSpread( ULONG ulPlayer );
834834 ULONG PLAYER_CalcRank( ULONG ulPlayer );
835835 void PLAYER_ScaleDamageCountWithMaxHealth( player_t *pPlayer, int &damage );
836+void PLAYER_ResetCustomValues( const ULONG ulPlayer );
836837
837838 void P_CheckPlayerSprite(AActor *mo, int &spritenum, fixed_t &scalex, fixed_t &scaley);
838839
diff -r 9a47035d9a7a -r 9f82c6b88d99 src/p_interaction.cpp
--- a/src/p_interaction.cpp Sun Mar 26 23:52:29 2023 -0400
+++ b/src/p_interaction.cpp Mon Mar 27 22:51:43 2023 -0400
@@ -3648,6 +3648,21 @@
36483648
36493649 //*****************************************************************************
36503650 //
3651+void PLAYER_ResetCustomValues( const ULONG ulPlayer )
3652+{
3653+ // [AK] Don't do anything if there is no data.
3654+ if ( gameinfo.CustomPlayerData.CountUsed( ) == 0 )
3655+ return;
3656+
3657+ TMapIterator<FName, CustomPlayerData> it( gameinfo.CustomPlayerData );
3658+ TMap<FName, CustomPlayerData>::Pair *pair;
3659+
3660+ while ( it.NextPair( pair ))
3661+ pair->Value.ResetToDefault( ulPlayer, false );
3662+}
3663+
3664+//*****************************************************************************
3665+//
36513666 CCMD (kill)
36523667 {
36533668 // Only allow it in a level.
diff -r 9a47035d9a7a -r 9f82c6b88d99 src/scoreboard.cpp
--- a/src/scoreboard.cpp Sun Mar 26 23:52:29 2023 -0400
+++ b/src/scoreboard.cpp Mon Mar 27 22:51:43 2023 -0400
@@ -3387,8 +3387,8 @@
33873387 }
33883388 }
33893389
3390- // [AK] Reset custom columns to their default values for all players.
3391- SCOREBOARD_ResetCustomColumnsForPlayer( MAXPLAYERS );
3390+ // [AK] Reset custom values to their default values for all players.
3391+ PLAYER_ResetCustomValues( MAXPLAYERS );
33923392
33933393 // [AK] It would be a good idea to refresh the scoreboard after resetting.
33943394 SCOREBOARD_ShouldRefreshBeforeRendering( );
@@ -3396,28 +3396,6 @@
33963396
33973397 //*****************************************************************************
33983398 //
3399-// [AK] SCOREBOARD_ResetCustomColumnsToDefault
3400-//
3401-// Resets all existing custom columns to their default values for one player
3402-// or all players (if MAXPLAYERS is passed).
3403-//
3404-//*****************************************************************************
3405-
3406-void SCOREBOARD_ResetCustomColumnsForPlayer( const ULONG ulPlayer )
3407-{
3408- // [AK] Don't do anything if there is no data.
3409- if ( gameinfo.CustomPlayerData.CountUsed( ) == 0 )
3410- return;
3411-
3412- TMapIterator<FName, CustomPlayerData> it( gameinfo.CustomPlayerData );
3413- TMap<FName, CustomPlayerData>::Pair *pair;
3414-
3415- while ( it.NextPair( pair ))
3416- pair->Value.ResetToDefault( ulPlayer, false );
3417-}
3418-
3419-//*****************************************************************************
3420-//
34213399 void SCOREBOARD_Render( ULONG ulDisplayPlayer )
34223400 {
34233401 // Make sure the display player is valid.
diff -r 9a47035d9a7a -r 9f82c6b88d99 src/scoreboard.h
--- a/src/scoreboard.h Sun Mar 26 23:52:29 2023 -0400
+++ b/src/scoreboard.h Mon Mar 27 22:51:43 2023 -0400
@@ -502,7 +502,6 @@
502502 ScoreColumn *SCOREBOARD_GetColumn( FName Name, const bool bMustBeUsable );
503503 bool SCOREBOARD_ShouldDrawBoard( void );
504504 void SCOREBOARD_Reset( const bool bChangingLevel );
505-void SCOREBOARD_ResetCustomColumnsForPlayer( const ULONG ulPlayer );
506505 void SCOREBOARD_Render( ULONG ulDisplayPlayer );
507506 void SCOREBOARD_Refresh( void );
508507 void SCOREBOARD_ShouldRefreshBeforeRendering( void );
diff -r 9a47035d9a7a -r 9f82c6b88d99 src/sv_main.cpp
--- a/src/sv_main.cpp Sun Mar 26 23:52:29 2023 -0400
+++ b/src/sv_main.cpp Mon Mar 27 22:51:43 2023 -0400
@@ -3039,8 +3039,8 @@
30393039 // [AK] Clear all the saved chat messages this player said.
30403040 CHAT_ClearChatMessages( ulClient );
30413041
3042- // [AK] Reset this player's custom columns to their default values.
3043- SCOREBOARD_ResetCustomColumnsForPlayer( ulClient );
3042+ // [AK] Reset this player's custom values to their default values.
3043+ PLAYER_ResetCustomValues( ulClient );
30443044
30453045 // [BB] Morphed players need to be unmorphed before disconnecting.
30463046 if (players[ulClient].morphTics)
Show on old repository browser