Douglas William Thrift 13 years ago
parent
commit
b5874c1b92
1 changed files with 3 additions and 2 deletions
  1. 3 2
      locationbot.py

+ 3 - 2
locationbot.py

@@ -339,9 +339,10 @@ class LocationBot(ircbot.SingleServerIRCBot):
 			if new_location != old_location: # old method
 			if new_location != old_location: # old method
 				return make_update_noise()
 				return make_update_noise()
 
 
+			distance = calc_distance(old_coordinates[0], old_coordinates[1],
+									 new_coordinates[0], new_coordinates[1])
+
 			if old_accuracy is not None and new_accuracy is not None:
 			if old_accuracy is not None and new_accuracy is not None:
-				distance = calc_distance(old_coordinates[0], old_coordinates[1],
-										 new_coordinates[0], new_coordinates[1])
 				avg_radius = (old_accuracy + new_accuracy) / 2
 				avg_radius = (old_accuracy + new_accuracy) / 2
 
 
 				if distance > avg_radius:
 				if distance > avg_radius: