equal
deleted
inserted
replaced
627 |
627 |
628 addBind(CurrentTeam^.Binds, id) |
628 addBind(CurrentTeam^.Binds, id) |
629 end; |
629 end; |
630 |
630 |
631 procedure chTeamGone(var s:shortstring); |
631 procedure chTeamGone(var s:shortstring); |
632 var t: LongInt; |
632 var t, i: LongInt; |
633 isSynced: boolean; |
633 isSynced: boolean; |
634 begin |
634 begin |
635 isSynced:= s[1] = 's'; |
635 isSynced:= s[1] = 's'; |
636 |
636 |
637 Delete(s, 1, 1); |
637 Delete(s, 1, 1); |
640 while (t < cMaxTeams) and (TeamsArray[t] <> nil) and (TeamsArray[t]^.TeamName <> s) do |
640 while (t < cMaxTeams) and (TeamsArray[t] <> nil) and (TeamsArray[t]^.TeamName <> s) do |
641 inc(t); |
641 inc(t); |
642 if (t = cMaxTeams) or (TeamsArray[t] = nil) then |
642 if (t = cMaxTeams) or (TeamsArray[t] = nil) then |
643 exit; |
643 exit; |
644 |
644 |
|
645 TeamsArray[t]^.isGoneFlagPengingToBeSet:= true; |
|
646 |
645 if isSynced then |
647 if isSynced then |
646 begin |
648 begin |
647 with TeamsArray[t]^ do |
649 for i:= 0 to Pred(cMaxTeams) do |
648 if not hasGone then |
650 with TeamsArray[i]^ do |
|
651 begin |
|
652 if (not hasGone) and isGoneFlagPengingToBeSet then |
649 begin |
653 begin |
650 AddChatString('** '+ TeamName + ' is gone'); |
654 AddChatString('** '+ TeamName + ' is gone'); // TODO: localize |
|
655 if not CurrentTeam^.ExtDriven then SendIPC(_S'f' + s); |
651 hasGone:= true; |
656 hasGone:= true; |
652 |
657 isGoneFlagPengingToBeSet:= false; |
653 RecountTeamHealth(TeamsArray[t]) |
658 RecountTeamHealth(TeamsArray[i]) |
654 end; |
659 end; |
655 end |
660 if hasGone and isGoneFlagPengingToBeUnset then |
|
661 ParseCommand('/teamback s' + s, true); |
|
662 end; |
|
663 end |
656 else |
664 else |
657 begin |
665 begin |
658 if not CurrentTeam^.ExtDriven then |
666 TeamsArray[t]^.isGoneFlagPengingToBeSet:= true; |
659 begin |
667 |
660 SendIPC(_S'f' + s); |
668 if (not CurrentTeam^.ExtDriven) or (CurrentTeam^.TeamName = s) then |
661 ParseCommand('/teamgone s' + s, true); |
669 ParseCommand('/teamgone s' + s, true); |
662 end; |
|
663 end; |
670 end; |
664 end; |
671 end; |
665 |
672 |
666 procedure chTeamBack(var s:shortstring); |
673 procedure chTeamBack(var s:shortstring); |
667 var t: LongInt; |
674 var t: LongInt; |
681 begin |
688 begin |
682 with TeamsArray[t]^ do |
689 with TeamsArray[t]^ do |
683 if hasGone then |
690 if hasGone then |
684 begin |
691 begin |
685 AddChatString('** '+ TeamName + ' is back'); |
692 AddChatString('** '+ TeamName + ' is back'); |
|
693 if not CurrentTeam^.ExtDriven then SendIPC(_S'g' + s); |
686 hasGone:= false; |
694 hasGone:= false; |
|
695 isGoneFlagPengingToBeUnset:= false; |
687 |
696 |
688 RecountTeamHealth(TeamsArray[t]); |
697 RecountTeamHealth(TeamsArray[t]); |
689 |
698 |
690 if Owner = UserNick then |
699 if Owner = UserNick then |
691 ExtDriven:= false |
700 ExtDriven:= false |
692 end; |
701 end; |
693 end |
702 end |
694 else |
703 else |
695 begin |
704 begin |
|
705 TeamsArray[t]^.isGoneFlagPengingToBeUnset:= true; |
|
706 |
696 if not CurrentTeam^.ExtDriven then |
707 if not CurrentTeam^.ExtDriven then |
697 begin |
|
698 SendIPC(_S'g' + s); |
|
699 ParseCommand('/teamback s' + s, true); |
708 ParseCommand('/teamback s' + s, true); |
700 end; |
|
701 end; |
709 end; |
702 end; |
710 end; |
703 |
711 |
704 |
712 |
705 procedure chFinish(var s:shortstring); |
713 procedure chFinish(var s:shortstring); |