fix for Issue 828: Manual placement animation is drawn twice
authorsheepluva
Mon, 24 Nov 2014 20:44:45 +0100
changeset 10547 cc439790ebae
parent 10546 339a005eab14
child 10548 28584bcb73a2
fix for issue #828: Manual placement animation is drawn twice
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsRender.pas
--- a/hedgewars/uGearsHandlersMess.pas	Mon Nov 24 04:16:28 2014 +0100
+++ b/hedgewars/uGearsHandlersMess.pas	Mon Nov 24 20:44:45 2014 +0100
@@ -2646,6 +2646,8 @@
         HHGear^.X := int2hwFloat(Gear^.Target.X);
         HHGear^.Y := int2hwFloat(Gear^.Target.Y);
         HHGear^.State := HHGear^.State or gstMoving;
+        if not Gear^.Hedgehog^.Unplaced then
+            Gear^.State:= Gear^.State or gstAnimation;
         Gear^.Hedgehog^.Unplaced := false;
         isCursorVisible := false;
         playSound(sndWarp)
--- a/hedgewars/uGearsRender.pas	Mon Nov 24 04:16:28 2014 +0100
+++ b/hedgewars/uGearsRender.pas	Mon Nov 24 20:44:45 2014 +0100
@@ -1205,7 +1205,7 @@
          gtAirBomb: DrawSpriteRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
         gtTeleport: begin
                     HHGear:= Gear^.Hedgehog^.Gear;
-                    if not Gear^.Hedgehog^.Unplaced then
+                    if ((Gear^.State and gstAnimation) <> 0) then
                         DrawSpriteRotatedF(sprTeleport, x + 1, y - 3, Gear^.Pos, hwSign(Gear^.dX), 0);
                     DrawSpriteRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0);
                     end;