Merge pull request #369 from kadimi/patch-26

Fix equation based stats in player lists
This commit is contained in:
Brian Miyaji
2020-04-09 22:49:26 +10:00
committed by GitHub

View File

@@ -613,11 +613,13 @@ class SP_Player_List extends SP_Secondary_Post {
endif;
endif;
if ( ! $stat->equation ) {
if ( $placeholder !== '' && is_numeric( $placeholder ) ):
$placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, 0 ) + $placeholder;
else:
$placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, '-' );
endif;
}
if ( is_numeric( $placeholder ) && $stat->precision ):
$placeholder = number_format( $placeholder, $stat->precision, '.', '' );