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