hedgewars/uTeams.pas
changeset 13877 8c702a4839ec
parent 13867 086aa3ae097f
child 14024 03a5d9f0bcc9
equal deleted inserted replaced
13876:aa321e51da14 13877:8c702a4839ec
   780 end;
   780 end;
   781 
   781 
   782 procedure chTeamGone(var s:shortstring);
   782 procedure chTeamGone(var s:shortstring);
   783 var t, i: LongInt;
   783 var t, i: LongInt;
   784     isSynced: boolean;
   784     isSynced: boolean;
   785     tmp: shortstring;
       
   786 begin
   785 begin
   787     isSynced:= s[1] = 's';
   786     isSynced:= s[1] = 's';
   788 
   787 
   789     Delete(s, 1, 1);
   788     Delete(s, 1, 1);
   790 
   789 
   801         for i:= 0 to Pred(TeamsCount) do
   800         for i:= 0 to Pred(TeamsCount) do
   802             with TeamsArray[i]^ do
   801             with TeamsArray[i]^ do
   803                 begin
   802                 begin
   804                 if (not hasGone) and isGoneFlagPendingToBeSet then
   803                 if (not hasGone) and isGoneFlagPendingToBeSet then
   805                     begin
   804                     begin
   806                     tmp:= ' ' + trmsg[sidTeamGone];
   805                     AddChatString(#7 + Format('* '+shortstring(trmsg[sidTeamGone]), TeamName));
   807                     tmp:= '*' + tmp;
       
   808                     AddChatString(#7 + Format(tmp, TeamName));
       
   809                     if not CurrentTeam^.ExtDriven then SendIPC(_S'f' + s);
   806                     if not CurrentTeam^.ExtDriven then SendIPC(_S'f' + s);
   810                     hasGone:= true;
   807                     hasGone:= true;
   811                     skippedTurns:= 0;
   808                     skippedTurns:= 0;
   812                     isGoneFlagPendingToBeSet:= false;
   809                     isGoneFlagPendingToBeSet:= false;
   813                     RecountTeamHealth(TeamsArray[i])
   810                     RecountTeamHealth(TeamsArray[i])
   826 end;
   823 end;
   827 
   824 
   828 procedure chTeamBack(var s:shortstring);
   825 procedure chTeamBack(var s:shortstring);
   829 var t: LongInt;
   826 var t: LongInt;
   830     isSynced: boolean;
   827     isSynced: boolean;
   831     tmp: shortstring;
       
   832 begin
   828 begin
   833     isSynced:= s[1] = 's';
   829     isSynced:= s[1] = 's';
   834 
   830 
   835     Delete(s, 1, 1);
   831     Delete(s, 1, 1);
   836 
   832 
   843     if isSynced then
   839     if isSynced then
   844         begin
   840         begin
   845         with TeamsArray[t]^ do
   841         with TeamsArray[t]^ do
   846             if hasGone then
   842             if hasGone then
   847                 begin
   843                 begin
   848                 tmp:= ' '+trmsg[sidTeamBack];
   844                 AddChatString(#8 + Format('* '+shortstring(trmsg[sidTeamBack]), TeamName));
   849                 tmp:= '*'+tmp;
       
   850                 AddChatString(#8 + Format(tmp, TeamName));
       
   851                 if not CurrentTeam^.ExtDriven then SendIPC(_S'g' + s);
   845                 if not CurrentTeam^.ExtDriven then SendIPC(_S'g' + s);
   852                 hasGone:= false;
   846                 hasGone:= false;
   853 
   847 
   854                 RecountTeamHealth(TeamsArray[t]);
   848                 RecountTeamHealth(TeamsArray[t]);
   855 
   849