hedgewars/uGears.pas
changeset 954 0cc31e998f4e
parent 943 a0c36a0b3ad9
child 955 474afaab0365
--- a/hedgewars/uGears.pas	Mon May 26 20:41:12 2008 +0000
+++ b/hedgewars/uGears.pas	Mon May 26 22:47:48 2008 +0000
@@ -209,6 +209,7 @@
                 Result^.Elasticity:= _0_35;
                 Result^.Friction:= _0_999;
                 Result^.Angle:= cMaxAngle div 2;
+                Result^.Pos:= GetRandom(19);
                 Result^.Z:= cHHZ;
                 end;
 gtAmmo_Grenade: begin
@@ -590,8 +591,7 @@
 			defaultPos:= false
 		end else
 
-	if (Gear^.Message and (gm_Left or gm_Right) <> 0)
-       or ((Gear^.State and gstAttacked) <> 0) then
+	if (Gear^.Message and (gm_Left or gm_Right) <> 0) then
 		begin
 		DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
 			hwSign(Gear^.dX),
@@ -602,6 +602,7 @@
 		end
     else
 
+	if ((Gear^.State and gstAttacked) = 0) then
 	begin
 		amt:= CurrentHedgehog^.Ammo^[CurrentHedgehog^.CurSlot, CurrentHedgehog^.CurAmmo].AmmoType;
 		case amt of
@@ -645,10 +646,11 @@
 end;
 
 if defaultPos then
-	DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
+	DrawRotatedF(sprHHIdle,
+		hwRound(Gear^.X) + 1 + WorldDx,
+		hwRound(Gear^.Y) - 3 + WorldDy,
+		(RealTicks div 256 + Gear^.Pos) mod 19,
 		hwSign(Gear^.dX),
-		0,
-		3,
 		0);
 
 with PHedgehog(Gear^.Hedgehog)^ do