# HG changeset patch # User sheepluva # Date 1416271900 -3600 # Node ID 58fa783e0cfdc2c7314a24ec778b9e60adc52e9c # Parent 25021aac078ea58d60cb89dc9eb54535713bda02 fixes to chat input history: remember all inputs, don not remember duplicates diff -r 25021aac078e -r 58fa783e0cfd hedgewars/uChat.pas --- a/hedgewars/uChat.pas Mon Nov 17 23:23:10 2014 +0100 +++ b/hedgewars/uChat.pas Tue Nov 18 01:51:40 2014 +0100 @@ -268,6 +268,13 @@ c, t: LongInt; x: byte; begin +if s <> LocalStrs[localLastStr] then + begin + // put in input history + localLastStr:= (localLastStr + 1) mod MaxStrIndex; + LocalStrs[localLastStr]:= s; + end; + t:= LocalTeam; x:= 0; if (s[1] = '"') and (s[Length(s)] = '"') @@ -295,10 +302,6 @@ if (s[1] = '/') then begin - // put in input history - localLastStr:= (localLastStr + 1) mod MaxStrIndex; - LocalStrs[localLastStr]:= s; - // These 3 are same as above, only are to make the hedgehog say it on next attack if (copy(s, 2, 4) = 'hsa ') then begin @@ -498,11 +501,7 @@ if copy(s, 1, 4) = '/me ' then s:= #2 + '* ' + UserNick + ' ' + copy(s, 5, Length(s) - 4) else - begin - localLastStr:= (localLastStr + 1) mod MaxStrIndex; - LocalStrs[localLastStr]:= s; s:= #1 + UserNick + ': ' + s; - end; AddChatString(s) end;