Fix player list adjustments for existing values
This commit is contained in:
@@ -481,8 +481,6 @@ class SP_Player_List extends SP_Custom_Post {
|
|||||||
$placeholders[ $player_id ] = array_merge( sp_array_value( $totals, $player_id, array() ), array_filter( sp_array_value( $placeholders, $player_id, array() ) ) );
|
$placeholders[ $player_id ] = array_merge( sp_array_value( $totals, $player_id, array() ), array_filter( sp_array_value( $placeholders, $player_id, array() ) ) );
|
||||||
|
|
||||||
foreach ( $stats as $stat ):
|
foreach ( $stats as $stat ):
|
||||||
if ( sp_array_value( $placeholders[ $player_id ], $stat->post_name, '' ) == '' ):
|
|
||||||
|
|
||||||
if ( $stat->equation === null ):
|
if ( $stat->equation === null ):
|
||||||
$placeholder = sp_array_value( sp_array_value( $adjustments, $player_id, array() ), $stat->post_name, null );
|
$placeholder = sp_array_value( sp_array_value( $adjustments, $player_id, array() ), $stat->post_name, null );
|
||||||
if ( $placeholder == null ):
|
if ( $placeholder == null ):
|
||||||
@@ -501,7 +499,8 @@ class SP_Player_List extends SP_Custom_Post {
|
|||||||
endif;
|
endif;
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
$placeholders[ $player_id ][ $stat->post_name ] = $placeholder;
|
if ( $placeholder ):
|
||||||
|
$placeholders[ $player_id ][ $stat->post_name ] = sp_array_value( $placeholders[ $player_id ], $stat->post_name, '' ) + $placeholder;
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user