fix side-effects of nemo's bottle-turnin'
authorsheepluva
Mon, 12 Sep 2011 06:31:10 +0200
changeset 5873 4f2d8ce3732b
parent 5872 454f246fe4c5
child 5874 5cd329cf2460
fix side-effects of nemo's bottle-turnin'
hedgewars/GSHandlers.inc
hedgewars/uGearsRender.pas
--- a/hedgewars/GSHandlers.inc	Sun Sep 11 21:32:49 2011 -0400
+++ b/hedgewars/GSHandlers.inc	Mon Sep 12 06:31:10 2011 +0200
@@ -523,7 +523,9 @@
     i:= max(32,152 - hwRound(Distance(Gear^.dX,Gear^.dY)*120))+random(10);
     if (GameTicks mod i) = 0 then
         begin
-        smoke:= AddVisualGear(hwRound(Gear^.X)-round(cos((Gear^.DirAngle+50) * pi / 180)*20), hwRound(Gear^.Y)-round(sin((Gear^.DirAngle+50) * pi / 180)*20), vgtSmoke);
+        // adjust angle to match the texture
+        if Gear^.dX.isNegative then i:= 130 else i:= 50;
+        smoke:= AddVisualGear(hwRound(Gear^.X)-round(cos((Gear^.DirAngle+i) * pi / 180)*20), hwRound(Gear^.Y)-round(sin((Gear^.DirAngle+i) * pi / 180)*20), vgtSmoke);
         if smoke <> nil then smoke^.Scale:= 0.75;
         end;
 
--- a/hedgewars/uGearsRender.pas	Sun Sep 11 21:32:49 2011 -0400
+++ b/hedgewars/uGearsRender.pas	Mon Sep 12 06:31:10 2011 +0200
@@ -888,7 +888,7 @@
        gtGasBomb: DrawRotated(sprCheese, x, y, 0, Gear^.DirAngle);
                   
        gtMolotov: if (Gear^.State and gstDrowning) = 0 then
-                       DrawRotatedF(sprMolotov, x, y, (RealTicks div 125) mod 8, hwSign(Gear^.dX), Gear^.DirAngle)
+                       DrawRotatedF(sprMolotov, x, y, (RealTicks div 125) mod 8, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX))
                   else DrawSprite(sprMolotov, x, y, 8);
 
        gtRCPlane: begin