Add support for hog name in home run message
authorWuzzy <almikes@aol.com>
Fri, 07 Apr 2017 04:56:51 +0200
changeset 12189 50856782cdc4
parent 12188 14cb1c9c78f2
child 12190 cb7d5fd2e515
Add support for hog name in home run message
hedgewars/uGearsHedgehog.pas
--- a/hedgewars/uGearsHedgehog.pas	Fri Apr 07 03:27:17 2017 +0200
+++ b/hedgewars/uGearsHedgehog.pas	Fri Apr 07 04:56:51 2017 +0200
@@ -937,6 +937,7 @@
 var isFalling, isUnderwater: boolean;
     land: Word;
     cnt: LongWord;
+    s: ansistring;
 begin
 if Gear^.Hedgehog^.Unplaced then
     begin
@@ -1188,7 +1189,8 @@
     if (Gear^.FlightTime > 1500) and ((hwRound(Gear^.X) < LongInt(leftX)-250) or (hwRound(Gear^.X) > LongInt(rightX)+250))  then
         begin
         Gear^.FlightTime:= 0;
-        AddCaption(GetEventString(eidHomerun), cWhiteColor, capgrpMessage);
+        s:= ansistring(CurrentHedgehog^.Name);
+        AddCaption(FormatA(GetEventString(eidHomerun), s), cWhiteColor, capgrpMessage);
         PlaySound(sndHomerun)
         end;
     end