comparison skillbot.pl @ 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
comparison
equal deleted inserted replaced
63:27f9196fd610 64:962dada7587e
508 return; 508 return;
509 } 509 }
510 510
511 # Check for changes in the skill, skip or cancel announcement 511 # Check for changes in the skill, skip or cancel announcement
512 if (defined $f->{skill}) { 512 if (defined $f->{skill}) {
513 # If the skill's the same, update the times 513 # If the skill's the same, check the finish time and skip if
514 if ($skill->id eq $f->{skill}) 514 # nothing's changed
515 { 515 return if ($skill->id eq $f->{skill}
516 $f->{skill_finish} = $skill->finish_time; 516 && $f{$f->{skill_finish} == $skill->finish_time);
517 return; 517
518 } 518 # Skill or finish time has changed, delete previous announcement
519
520 # Skill has changed, delet previous announcement
521 del_one_shot_timer($f->{timer}); 519 del_one_shot_timer($f->{timer});
522 delete $f->{timer}; 520 delete $f->{timer};
523 } 521 }
524 522
525 my $finish = $skill->finish_time - time(); 523 my $finish = $skill->finish_time - time();