hedgewars/uChat.pas
changeset 8735 42892d1fb9e1
parent 8516 e422cbf9aa33
child 8736 997ed94843c4
--- a/hedgewars/uChat.pas	Sat Mar 16 23:29:50 2013 +0100
+++ b/hedgewars/uChat.pas	Sat Mar 16 23:50:50 2013 +0100
@@ -296,7 +296,7 @@
 var i, btw: integer;
     utf8: shortstring;
 begin
-if Key <> 0 then
+    if Key <> 0 then
     case Key of
         {Backspace}
         8, 127: if Length(InputStr.s) > 0 then
@@ -325,32 +325,32 @@
             GameState:= gsGame;
             ResetKbd;
             end;
-    else
-        if (Key < $80) then
-            btw:= 1
-        else if (Key < $800) then
-            btw:= 2
-        else if (Key < $10000) then
-            btw:= 3
         else
-            btw:= 4;
+            if (Key < $80) then
+                btw:= 1
+            else if (Key < $800) then
+                btw:= 2
+            else if (Key < $10000) then
+                btw:= 3
+            else
+                btw:= 4;
 
-    utf8:= '';
+            utf8:= '';
 
-    for i:= btw downto 2 do
-        begin
-        utf8:= char((Key or $80) and $BF) + utf8;
-        Key:= Key shr 6
-        end;
+            for i:= btw downto 2 do
+                begin
+                utf8:= char((Key or $80) and $BF) + utf8;
+                Key:= Key shr 6
+                end;
 
-    utf8:= char(Key or firstByteMark[Pred(btw)]) + utf8;
+            utf8:= char(Key or firstByteMark[Pred(btw)]) + utf8;
 
-    if byte(InputStr.s[0]) + btw > 240 then
-        exit;
+            if byte(InputStr.s[0]) + btw > 240 then
+                exit;
 
-    InputStrL[byte(InputStr.s[0]) + btw]:= InputStr.s[0];
-    SetLine(InputStr, InputStr.s + utf8, true)
-    end
+            InputStrL[byte(InputStr.s[0]) + btw]:= InputStr.s[0];
+            SetLine(InputStr, InputStr.s + utf8, true)
+        end
 end;
 
 procedure chChatMessage(var s: shortstring);