Make hogs keep their hat when holding the baseball bat
authoralfadur
Fri, 28 Apr 2017 17:49:15 +0200
changeset 12376 c80c51f59a98
parent 12375 3126214d0e7d
child 12377 efa13b925cd8
Make hogs keep their hat when holding the baseball bat
hedgewars/uGearsRender.pas
--- a/hedgewars/uGearsRender.pas	Fri Apr 28 04:42:04 2017 +0200
+++ b/hedgewars/uGearsRender.pas	Fri Apr 28 17:49:15 2017 +0200
@@ -820,11 +820,15 @@
                             0,
                             sign,
                             0);
-                amBaseballBat: DrawHedgehog(sx, sy,
+                amBaseballBat:
+                    begin
+                    HatVisible:= true;
+                    DrawHedgehog(sx, sy,
                             sign,
                             0,
                             5,
                             0);
+                    end
             else
                 DrawHedgehog(sx, sy,
                     sign,
@@ -1028,7 +1032,19 @@
                 amJetpack: DrawSprite(sprJetpack, sx-32, sy-32, 0);
                 end
             end; *)
-        if CurAmmoGear <> nil then
+        if (CurAmmoGear = nil) then
+            begin
+            if ((Gear^.State and (gstAttacked or gstAnimation or gstHHJumping)) = 0)
+            and (Gear^.Message and (gmLeft or gmRight) = 0) then
+            begin
+                amt:= CurrentHedgehog^.CurAmmoType;
+                case amt of
+                    amBaseballBat: DrawSpritePivotedF(sprHandBaseball,
+                        sx + 9 * sign, sy + 2, 0, sign, -8, 1, aangle);
+                end;
+            end;
+            end
+        else
             begin
             aangle:= Gear^.Angle * 180 / cMaxAngle - 90;
             case CurAmmoGear^.Kind of