- Fix warning
authorunc0rr
Fri, 25 Apr 2008 21:44:58 +0000
changeset 874 964c0d5b3604
parent 873 9bec5af9b23c
child 875 226d0de2fb68
- Fix warning - Small optimization in DrawHH function - Fix high jump hedgehog animation not to turn hedgehog view
hedgewars/uGears.pas
hedgewars/uStats.pas
--- a/hedgewars/uGears.pas	Fri Apr 25 20:41:23 2008 +0000
+++ b/hedgewars/uGears.pas	Fri Apr 25 21:44:58 2008 +0000
@@ -500,12 +500,12 @@
 	end;
 defaultPos:= true;
 
-hx:= hwRound(Gear^.X) + 1 + 8 * hwSign(Gear^.dX) + WorldDx;
-hy:= hwRound(Gear^.Y) - 2 + WorldDy;
-aangle:= Gear^.Angle * 180 / cMaxAngle - 90;
-
 if (Gear^.State and gstHHDriven) <> 0 then
 begin
+	hx:= hwRound(Gear^.X) + 1 + 8 * hwSign(Gear^.dX) + WorldDx;
+	hy:= hwRound(Gear^.Y) - 2 + WorldDy;
+	aangle:= Gear^.Angle * 180 / cMaxAngle - 90;
+
 	if CurAmmoGear <> nil then
 	begin
 		case CurAmmoGear^.Kind of
@@ -540,15 +540,24 @@
 			gtTeleport: defaultPos:= false;
 		end
 	end else
+
 	if ((Gear^.State and gstHHJumping) <> 0) then
 		begin
-		DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
-			hwSign(Gear^.dX),
-			1,
-			1,
-			0);
+		if ((Gear^.State and gstHHHJump) <> 0) then
+			DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
+				- hwSign(Gear^.dX),
+				1,
+				1,
+				0)
+			else
+			DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
+				hwSign(Gear^.dX),
+				1,
+				1,
+				0);
 			defaultPos:= false
 		end else
+
 	if (Gear^.Message and (gm_Left or gm_Right) <> 0)
        or ((Gear^.State and gstAttacked) <> 0) then
 		begin
@@ -560,6 +569,7 @@
 			defaultPos:= false
 		end
     else
+
 	begin
 		amt:= CurrentHedgehog^.Ammo^[CurrentHedgehog^.CurSlot, CurrentHedgehog^.CurAmmo].AmmoType;
 		case amt of
--- a/hedgewars/uStats.pas	Fri Apr 25 20:41:23 2008 +0000
+++ b/hedgewars/uStats.pas	Fri Apr 25 21:44:58 2008 +0000
@@ -79,8 +79,7 @@
 end;
 
 procedure TurnReaction;
-var Gear: PGear;
-    i, t: LongInt;
+var i, t: LongInt;
 begin
 inc(FinishedTurnsTotal);
 if FinishedTurnsTotal = 0 then exit;