リビジョン | 70919e31790ea77cc133e05856d36b9d04d6c528 (tree) |
---|---|
日時 | 2022-05-14 22:51:33 |
作者 | Adam Kaminski <kaminskiadam9@gmai...> |
コミッター | Adam Kaminski |
Call PLAYER_SetKills any time a player's kill count increments. This removes some minor duplicate code, and also refreshes the HUD (this already happens when clients receive the SetPlayerKillCount server command).
@@ -541,17 +541,9 @@ | ||
541 | 541 | if ((CountsAsKill()) && |
542 | 542 | ( NETWORK_InClientMode() == false )) |
543 | 543 | { // count for intermission |
544 | - source->player->killcount++; | |
545 | - | |
546 | - // Update the clients with this player's updated killcount. | |
547 | - if ( NETWORK_GetState( ) == NETSTATE_SERVER ) | |
548 | - { | |
549 | - SERVERCOMMANDS_SetPlayerKillCount( ULONG( source->player - players ) ); | |
550 | - | |
551 | - // Also, update the scoreboard. | |
552 | - SERVERCONSOLE_UpdatePlayerInfo( ULONG( source->player - players ), UDF_FRAGS ); | |
553 | - SERVERCONSOLE_UpdateScoreboard( ); | |
554 | - } | |
544 | + // [AK] Call PLAYER_SetKills to increment the kill count instead. | |
545 | + PLAYER_SetKills( source->player, source->player->killcount + 1 ); | |
546 | + //source->player->killcount++; | |
555 | 547 | } |
556 | 548 | |
557 | 549 | // Don't count any frags at level start, because they're just telefrags |
@@ -679,7 +671,11 @@ | ||
679 | 671 | // Why give player 0 credit? :P |
680 | 672 | // Meh, just do it in single player. |
681 | 673 | if ( NETWORK_GetState( ) == NETSTATE_SINGLE ) |
682 | - players[0].killcount++; | |
674 | + { | |
675 | + // [AK] Call PLAYER_SetKills to increment the kill count instead. | |
676 | + PLAYER_SetKills( &players[0], players[0].killcount + 1 ); | |
677 | + // players[0].killcount++; | |
678 | + } | |
683 | 679 | |
684 | 680 | if ( NETWORK_GetState( ) == NETSTATE_SERVER ) |
685 | 681 | { |