comparison ICU.lua @ 15:21cefa363c73 tip

Last modification to ready checking broke something ... Now its fixed and ready checking is working as intended.
author Xiiph
date Fri, 25 Feb 2011 01:21:13 +0100
parents ed15bd476bbb
children
comparison
equal deleted inserted replaced
14:4c6367b8e640 15:21cefa363c73
578 578
579 function icu:READY_CHECK_CONFIRM(event,unit,status) 579 function icu:READY_CHECK_CONFIRM(event,unit,status)
580 local raider = UnitName(unit); 580 local raider = UnitName(unit);
581 581
582 --@debug@ 582 --@debug@
583 print(unit); 583 print("Thingy:",unit,responders[#responders],responders[#responders-1]);
584 --@end-debug@ 584 --@end-debug@
585 585
586 -- Check if the latest entires contain the raider... 586 -- Iterate through all responders to avoid duplicates, abort on match
587 -- The event fires twice for units in your party, 587 -- The event fires twice for units in your party,
588 -- and may fire a THIRD time if you have the person targetted ... 588 -- and may fire a THIRD time if you have the person targetted ...
589 if (responders[#responders] == raider or responders[#responders-1] == raider) then return end 589 for i = 1,#responders do
590 if responders[i] == raider then
591 --@debug@
592 print("Found match, aborting");
593 print(responders[i],raider);
594 --@end-debug@
595 return true;
596 end
597 end
590 598
591 -- Raider is NOT afk, but might not be ready 599 -- Raider is NOT afk, but might not be ready
592 responders[#responders+1] = raider; 600 responders[#responders+1] = raider;
593 601
594 -- 1 ready, 0 not ready 602 -- 1 ready, 0 not ready
614 --@debug@ 622 --@debug@
615 print(raider); 623 print(raider);
616 --@end-debug@ 624 --@end-debug@
617 625
618 for i = 1, #responders do 626 for i = 1, #responders do
619 print("Iterating through responders ...");
620 print(responders[i],raider);
621 if responders[i] == raider then 627 if responders[i] == raider then
622 --@debug@ 628 --@debug@
623 print(responders[i],raider); 629 print(responders[i],raider);
624 --@end-debug@ 630 --@end-debug@
625 matchFound = true; 631 matchFound = true;