# HG changeset patch # User unc0rr # Date 1203620347 0 # Node ID 346c886bca7b878365e5074ddf5474c5304695ae # Parent ac538f1a629ebf765afd3f0af15a0ec53a2774fa Some bugfixing diff -r ac538f1a629e -r 346c886bca7b hedgewars/uConsole.pas --- a/hedgewars/uConsole.pas Thu Feb 21 18:48:16 2008 +0000 +++ b/hedgewars/uConsole.pas Thu Feb 21 18:59:07 2008 +0000 @@ -246,8 +246,8 @@ begin if InputStr.s[0] = #0 then exit; c:= InputStr.s[1]; -if c in ['/', '$'] then Delete(InputStr.s, 1, 1) - else c:= #0; +if c in ['/', '$'] then Delete(InputStr.s, 1, 1) else c:= #0; + if InputStr.s[byte(InputStr.s[0])] = #32 then dec(InputStr.s[0]); t:= Variables; while t <> nil do @@ -256,8 +256,8 @@ ((t^.VType <> vtCommand) and (c='$'))then if copy(t^.Name, 1, Length(InputStr.s)) = InputStr.s then begin - if t^.VType = vtCommand then InputStr.s:= '/' + t^.Name + ' ' - else InputStr.s:= '$' + t^.Name + ' '; + if t^.VType = vtCommand then SetLine(InputStr, '/' + t^.Name + ' ') + else SetLine(InputStr, '$' + t^.Name + ' '); exit end; t:= t^.Next @@ -271,14 +271,18 @@ begin if Key <> 0 then case Key of - 8: if Length(InputStr.s)>0 then dec(InputStr.s[0]); + 8: if Length(InputStr.s) > 0 then + begin + dec(InputStr.s[0]); + SetLine(InputStr, InputStr.s) + end; 9: AutoComplete; 13,271: begin if InputStr.s[1] in ['/', '$'] then ParseCommand(InputStr.s, false) else ParseCommand('/say ' + InputStr.s, false); - InputStr.s:= '' + SetLine(InputStr, '') end else if (Key < $80) then btw:= 1