diff --git a/game-on.php b/game-on.php index e1727824..32340194 100755 --- a/game-on.php +++ b/game-on.php @@ -5,7 +5,7 @@ Description: Gamification tools for teachers. Author: Valhalla Mac Lab Author URI: https://github.com/TheMacLab/game-on/blob/master/README.md -Version: 2.5.8 +Version: 2.5.9 */ include( 'go_datatable.php' ); diff --git a/go_pnc.php b/go_pnc.php index d762c911..f802da55 100644 --- a/go_pnc.php +++ b/go_pnc.php @@ -498,8 +498,8 @@ function go_return_multiplier( $user_id, $points, $currency, $user_bonuses, $use $bonus_threshold = (int) get_option( 'go_multiplier_threshold', 10 ); $penalty_threshold = (int) get_option( 'go_penalty_threshold', 5 ); $multiplier = ( (int) get_option( 'go_multiplier_percentage', 10 ) ) / 100; - $bonus_frac = intval( $user_bonuses / $bonus_threshold ); - $penalty_frac = intval( $user_penalties / $penalty_threshold ); + $bonus_frac = ( $user_bonuses > 0 ? intval( $user_bonuses / $bonus_threshold ) : 0 ); + $penalty_frac = ( $user_penalties > 0 ? intval( $user_penalties / $penalty_threshold ) : 0 ); $diff = $bonus_frac - $penalty_frac; if ( $diff == 0 ) { if ( $return_mod === false ) {