From d4782758aa9e8948775526f9bb8189d8b131e4a6 Mon Sep 17 00:00:00 2001 From: dave Date: Wed, 17 Feb 2010 18:34:29 +0000 Subject: [PATCH] Don't use round2 scoring in the cost funciton if there is no round2 --- admin/judges_sa.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/admin/judges_sa.php b/admin/judges_sa.php index 71460b99..7421c86d 100644 --- a/admin/judges_sa.php +++ b/admin/judges_sa.php @@ -42,6 +42,10 @@ function TRACE_R($array) { print_r($array); } TRACE("
");
 
+$round_divisional1 = NULL;
+$round_divisional2 = NULL;
+
+
 
 function set_status($txt)
 {
@@ -89,7 +93,8 @@ function judges_cost_function($annealer, $bucket_id, $ids)
 {
 	global $config;
 	global $jteam;
-	global $judges;
+	global $judges, $round_divisional2;
+
 	/* Bucket ID is the team number */
 	/* ids are the judge ids currently in the bucket */
 
@@ -166,8 +171,10 @@ function judges_cost_function($annealer, $bucket_id, $ids)
 		$cost += 40;
 
 	/* Huge penalty for not having a round2 person on the team */
-	if($have_div2 == false) 
-		$cost += 40;
+	if($round_divisional2 != NULL) {
+		if($have_div2 == false) 
+			$cost += 40;
+	}
  
 //	TRACE("Team $bucket_id, cost is $cost\n");
 
@@ -334,8 +341,6 @@ while($r=mysql_fetch_object($q)) {
 }
 
 TRACE("Loading Judging Round time data...\n");
-$round_divisional1 = NULL;
-$round_divisional2 = NULL;
 $round_special_awards = array();
 $round = array();
 $q = mysql_query("SELECT * FROM judges_timeslots WHERE round_id='0' AND `year`='{$config['FAIRYEAR']}'");