changeset 18:10587dbd634b

Ignoring bad data which was actually negative
author Dominic Cleal <dominic@computerkb.co.uk>
date Sat, 06 Dec 2008 17:27:17 +0000
parents bef72aa85f2b
children 40154257e632
files skillbot.pl
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/skillbot.pl	Sat Dec 06 16:49:36 2008 +0000
+++ b/skillbot.pl	Sat Dec 06 17:27:17 2008 +0000
@@ -367,7 +367,7 @@
 					$loaded++;
 				}
 				
-				if (defined $c && $loaded == 0)
+				if (defined $c && $loaded eq 0)
 				{
 					irc_debug("EVE: Unable to find character %s for ID %lu",
 							  $c, $uid);
@@ -415,19 +415,19 @@
 
 	# Check for changes in the skill, skip or cancel announcement
 	if (defined $f->{skill}) {
-		next if $skill->id == $f->{skill}->id;
+		return if $skill->id eq $f->{skill}->id;
 		del_one_shot_timer($f->{timer});
 	}
 
 	my $finish = $skill->finish_time - time();
 	my $prefinish = $finish - 60;
 
-	irc_debug("Character %s is training %s %lu (%s == %lu sec)",
+	irc_debug("Character %s is training %s %d (%s == %d sec)",
 			  $f->{char}->name, $skill->name, $skill->level,
 			  $skill->time_remaining, $finish);
 
-	# Cap time at 3 months to ignore bad data
-	if ($finish > 60 * 60 * 24 * 90)
+	# Ignore bad data
+	if ($finish < 0)
 	{
 		irc_debug("Unreasonable finish time given of %s seconds, ignoring",
 				  $finish);