Make sure AddChatString is only fed with shortstrings
authorWuzzy <Wuzzy2@mail.ru>
Sat, 06 Oct 2018 00:23:27 +0200
changeset 13891 26ebbf9717fd
parent 13889 086aa3ae097f
child 13892 5df16be168ff
Make sure AddChatString is only fed with shortstrings
hedgewars/uGears.pas
hedgewars/uGearsHedgehog.pas
hedgewars/uScript.pas
--- a/hedgewars/uGears.pas	Fri Oct 05 23:51:58 2018 +0200
+++ b/hedgewars/uGears.pas	Sat Oct 06 00:23:27 2018 +0200
@@ -1221,7 +1221,7 @@
                 Gear^.Text:= text;
                 Gear^.FrameTicks:= x
                 end;
-            AddChatString(#9+FormatA(trmsg[sidChatHog], ansistring(HH^.Name), ansistring(text)));
+            AddChatString(#9+Format(trmsg[sidChatHog], HH^.Name, text));
             end
         end
     else if (x >= 4) then
--- a/hedgewars/uGearsHedgehog.pas	Fri Oct 05 23:51:58 2018 +0200
+++ b/hedgewars/uGearsHedgehog.pas	Sat Oct 06 00:23:27 2018 +0200
@@ -51,7 +51,7 @@
     t:= 0;
     while (TeamsArray[t] <> CurrentTeam) do inc(t);
 
-    AddChatString(#2 + FormatA(trmsg[sidAutoSkip], CurrentTeam^.TeamName));
+    AddChatString(#2 + Format(trmsg[sidAutoSkip], CurrentTeam^.TeamName));
 
     ParseCommand('/skip', true)
 end;
@@ -584,7 +584,7 @@
                     speech^.Text:= SpeechText;
                     speech^.Hedgehog:= Gear^.Hedgehog;
                     speech^.FrameTicks:= SpeechType;
-                    AddChatString(#9+FormatA(trmsg[sidChatHog], Gear^.Hedgehog^.Name, SpeechText));
+                    AddChatString(#9+Format(trmsg[sidChatHog], Gear^.Hedgehog^.Name, SpeechText));
                     end;
                 SpeechText:= ''
                 end;
--- a/hedgewars/uScript.pas	Fri Oct 05 23:51:58 2018 +0200
+++ b/hedgewars/uScript.pas	Sat Oct 06 00:23:27 2018 +0200
@@ -1651,7 +1651,7 @@
                vgear^.Text:= lua_tostring(L, 2);
                if Gear^.Kind = gtHedgehog then
                    begin
-                   AddChatString(#9+FormatA(trmsg[sidChatHog], gear^.Hedgehog^.Name, vgear^.text));
+                   AddChatString(#9+Format(trmsg[sidChatHog], gear^.Hedgehog^.Name, vgear^.text));
                    vgear^.Hedgehog:= gear^.Hedgehog
                    end
                else vgear^.Frame:= gear^.uid;