# HG changeset patch # User Wuzzy # Date 1538667961 -7200 # Node ID d1f7a8a11526fc54b87d042f5733cd2300230506 # Parent 266a25b79374345c85aea65c5fe61bd702e90899 Ignore message-type chat commands (/hsa, /clan, etc.) w/ empty arg list diff -r 266a25b79374 -r d1f7a8a11526 hedgewars/uChat.pas --- a/hedgewars/uChat.pas Thu Oct 04 17:30:24 2018 +0200 +++ b/hedgewars/uChat.pas Thu Oct 04 17:46:01 2018 +0200 @@ -437,12 +437,15 @@ t:= LocalTeam; x:= 0; +// speech bubble if (s[1] = '"') and (s[Length(s)] = '"') then x:= 1 +// thinking bubble else if (s[1] = '''') and (s[Length(s)] = '''') then x:= 2 +// yelling bubble else if (s[1] = '-') and (s[Length(s)] = '-') then x:= 3; @@ -462,7 +465,16 @@ if (s[1] = '/') then begin - // These 3 are same as above, only are to make the hedgehog say it on next attack + + // Ignore message-type commands with empty argument list + if (copy(s, 2, 2) = 'me') and (Length(s) = 3) then + exit; + if ((copy(s, 2, 3) = 'hsa') or (copy(s, 2, 3) = 'hta') or (copy(s, 2, 3) = 'hya')) and (Length(s) = 4) then + exit; + if ((copy(s, 2, 4) = 'team') or (copy(s, 2, 4) = 'clan')) and (Length(s) = 5) then + exit; + + // Speech bubble, but on next attack if (copy(s, 2, 4) = 'hsa ') then begin if CurrentTeam^.ExtDriven then @@ -472,6 +484,7 @@ exit end; + // Thinking bubble, but on next attack if (copy(s, 2, 4) = 'hta ') then begin if CurrentTeam^.ExtDriven then @@ -481,6 +494,7 @@ exit end; + // Yelling bubble, but on next attack if (copy(s, 2, 4) = 'hya ') then begin if CurrentTeam^.ExtDriven then