Revision | 9f82c6b88d99e1ae1b2431330370635bfe39e3f8 (tree) |
---|---|
Time | 2023-03-28 11:51:43 |
Author | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Renamed SCOREBOARD_ResetCustomColumnsForPlayer to PLAYER_ResetCustomValues, and moved it to "p_interaction.cpp".
@@ -597,8 +597,8 @@ | ||
597 | 597 | // [AK] Clear all the saved chat messages this bot said. |
598 | 598 | CHAT_ClearChatMessages( ulPlayerIdx ); |
599 | 599 | |
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 ); | |
602 | 602 | |
603 | 603 | // [BB] Morphed bots need to be unmorphed before disconnecting. |
604 | 604 | if (players[ulPlayerIdx].morphTics) |
@@ -4544,8 +4544,8 @@ | ||
4544 | 4544 | // [AK] Clear all the saved chat messages this player said. |
4545 | 4545 | CHAT_ClearChatMessages( player - players ); |
4546 | 4546 | |
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 ); | |
4549 | 4549 | |
4550 | 4550 | // Zero out all the player information. |
4551 | 4551 | PLAYER_ResetPlayerData( player ); |
@@ -833,6 +833,7 @@ | ||
833 | 833 | LONG PLAYER_CalcSpread( ULONG ulPlayer ); |
834 | 834 | ULONG PLAYER_CalcRank( ULONG ulPlayer ); |
835 | 835 | void PLAYER_ScaleDamageCountWithMaxHealth( player_t *pPlayer, int &damage ); |
836 | +void PLAYER_ResetCustomValues( const ULONG ulPlayer ); | |
836 | 837 | |
837 | 838 | void P_CheckPlayerSprite(AActor *mo, int &spritenum, fixed_t &scalex, fixed_t &scaley); |
838 | 839 |
@@ -3648,6 +3648,21 @@ | ||
3648 | 3648 | |
3649 | 3649 | //***************************************************************************** |
3650 | 3650 | // |
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 | +// | |
3651 | 3666 | CCMD (kill) |
3652 | 3667 | { |
3653 | 3668 | // Only allow it in a level. |
@@ -3387,8 +3387,8 @@ | ||
3387 | 3387 | } |
3388 | 3388 | } |
3389 | 3389 | |
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 ); | |
3392 | 3392 | |
3393 | 3393 | // [AK] It would be a good idea to refresh the scoreboard after resetting. |
3394 | 3394 | SCOREBOARD_ShouldRefreshBeforeRendering( ); |
@@ -3396,28 +3396,6 @@ | ||
3396 | 3396 | |
3397 | 3397 | //***************************************************************************** |
3398 | 3398 | // |
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 | -// | |
3421 | 3399 | void SCOREBOARD_Render( ULONG ulDisplayPlayer ) |
3422 | 3400 | { |
3423 | 3401 | // Make sure the display player is valid. |
@@ -502,7 +502,6 @@ | ||
502 | 502 | ScoreColumn *SCOREBOARD_GetColumn( FName Name, const bool bMustBeUsable ); |
503 | 503 | bool SCOREBOARD_ShouldDrawBoard( void ); |
504 | 504 | void SCOREBOARD_Reset( const bool bChangingLevel ); |
505 | -void SCOREBOARD_ResetCustomColumnsForPlayer( const ULONG ulPlayer ); | |
506 | 505 | void SCOREBOARD_Render( ULONG ulDisplayPlayer ); |
507 | 506 | void SCOREBOARD_Refresh( void ); |
508 | 507 | void SCOREBOARD_ShouldRefreshBeforeRendering( void ); |
@@ -3039,8 +3039,8 @@ | ||
3039 | 3039 | // [AK] Clear all the saved chat messages this player said. |
3040 | 3040 | CHAT_ClearChatMessages( ulClient ); |
3041 | 3041 | |
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 ); | |
3044 | 3044 | |
3045 | 3045 | // [BB] Morphed players need to be unmorphed before disconnecting. |
3046 | 3046 | if (players[ulClient].morphTics) |