Fix player list adjustments for existing values

This commit is contained in:
Brian Miyaji
2016-12-06 13:57:34 +11:00
parent 084f45fa33
commit 20bc2267bc

View File

@@ -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() ) ) );
foreach ( $stats as $stat ):
if ( sp_array_value( $placeholders[ $player_id ], $stat->post_name, '' ) == '' ):
if ( $stat->equation === null ):
$placeholder = sp_array_value( sp_array_value( $adjustments, $player_id, array() ), $stat->post_name, null );
if ( $placeholder == null ):
@@ -501,7 +499,8 @@ class SP_Player_List extends SP_Custom_Post {
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;
endforeach;