changeset 64:962dada7587e

Reset timer when the finish time has changed for the same skill
author Dominic Cleal <dominic@computerkb.co.uk>
date Sat, 21 Nov 2009 12:31:28 +0000
parents 27f9196fd610
children 680fca147aee de14128c1858
files skillbot.pl
diffstat 1 files changed, 6 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/skillbot.pl	Sat Feb 21 01:03:33 2009 +0000
+++ b/skillbot.pl	Sat Nov 21 12:31:28 2009 +0000
@@ -510,14 +510,12 @@
 
 	# Check for changes in the skill, skip or cancel announcement
 	if (defined $f->{skill}) {
-		# If the skill's the same, update the times
-		if ($skill->id eq $f->{skill})
-		{
-			$f->{skill_finish} = $skill->finish_time;
-			return;
-		}
-
-		# Skill has changed, delet previous announcement
+		# If the skill's the same, check the finish time and skip if
+		# nothing's changed
+		return if ($skill->id eq $f->{skill}
+				&& $f{$f->{skill_finish} == $skill->finish_time);
+		
+		# Skill or finish time has changed, delete previous announcement
 		del_one_shot_timer($f->{timer});
 		delete $f->{timer};
 	}