changeset 10863 | 9d3e1123bd43 |
parent 10853 | 287634baf7ba |
child 10866 | c1f75780c56f |
--- a/hedgewars/uChat.pas Wed Mar 18 23:18:52 2015 +0300 +++ b/hedgewars/uChat.pas Wed Mar 18 21:52:13 2015 +0100 @@ -204,8 +204,15 @@ end else begin - color:= colors[str[1]]; - delete(str, 1, 1); + if str[1] <= High(colors) then + begin + color:= colors[str[1]]; + delete(str, 1, 1); + end + // fallback if invalid color + else + color:= colors[Low(colors)]; + cl.s:= str; end;