hedgewars/uChat.pas
changeset 10868 acb03a9712c3
parent 10866 c1f75780c56f
child 10919 8aed2bfc43c5
equal deleted inserted replaced
10867:36ca7a39f34d 10868:acb03a9712c3
   343     if (Length(InputStr.s) > 0) and ((CursorPos = 1) or (CursorPos = 2)) then
   343     if (Length(InputStr.s) > 0) and ((CursorPos = 1) or (CursorPos = 2)) then
   344         begin
   344         begin
   345         c:= InputStr.s[1];
   345         c:= InputStr.s[1];
   346         if charIsForHogSpeech(c) then
   346         if charIsForHogSpeech(c) then
   347             begin
   347             begin
   348             SpeechHogNumber:= 1;
   348             SpeechHogNumber:= 0;
   349             if Length(InputStr.s) > 1 then
   349             if Length(InputStr.s) > 1 then
   350                 begin
   350                 begin
   351                 c:= InputStr.s[2];
   351                 c:= InputStr.s[2];
   352                 if (c > '0') and (c < '9') then
   352                 if (c > '0') and (c < '9') then
   353                     SpeechHogNumber:= byte(c) - 48;
   353                     SpeechHogNumber:= byte(c) - 48;
   354                 end;
   354                 end;
       
   355             // default to current hedgehog (if own) or first hedgehog
       
   356             if SpeechHogNumber = 0 then
       
   357                 begin
       
   358                 if not CurrentTeam^.ExtDriven then
       
   359                     SpeechHogNumber:= CurrentTeam^.CurrHedgehog + 1
       
   360                 else
       
   361                     SpeechHogNumber:= 1;
       
   362                 end;
   355             end;
   363             end;
   356         end
   364         end
   357     else
   365     else
   358         SpeechHogNumber:= 0;
   366         SpeechHogNumber:= -1;
   359     end
   367     end
   360 else
   368 else
   361     SpeechHogNumber:= 0;
   369     SpeechHogNumber:= -1;
   362 
   370 
   363 // draw chat lines
   371 // draw chat lines
   364 if ((not ChatHidden) or showAll) and (UIDisplay <> uiNone) then
   372 if ((not ChatHidden) or showAll) and (UIDisplay <> uiNone) then
   365     begin
   373     begin
   366     if MissedCount <> 0 then // there are chat strings we missed, so print them now
   374     if MissedCount <> 0 then // there are chat strings we missed, so print them now