hedgewars/GSHandlers.inc
changeset 3161 cb5f04cc9d76
parent 3151 3f23113d9df4
child 3169 c8c6ac44f51b
--- a/hedgewars/GSHandlers.inc	Mon Mar 29 20:27:54 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Mon Mar 29 20:32:35 2010 +0000
@@ -2796,7 +2796,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepBirdyFly(Gear: PGear);
 var HHGear: PGear;
-    fuel: LongInt;
+    fuel, i: LongInt;
     move: hwFloat;
 begin
 HHGear:= CurrentHedgehog^.Gear;
@@ -2831,10 +2831,11 @@
     end;
 
 if Gear^.Health < 0 then Gear^.Health:= 0;
-if (GameTicks and $3F) = 0 then
+if (GameTicks and $7F) = 0 then
        begin
-       if Gear^.Health < 500 then
-         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtFeather);
+       if Gear^.Health < 1000 then
+            for i:= ((1000-Gear^.Health) div 250) downto 0 do
+                AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtFeather);
        if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
        Gear^.Tex:= RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(round(Gear^.Health / 20)) + '%', cWhiteColor, fntSmall)
        end;
@@ -2873,21 +2874,12 @@
         Active:= true;
         State:= State or gstMoving
         end;
-    if Gear^.Tag = -1 then
+    Gear^.State:= Gear^.State or gstAnimation or gstTmpFlag;
+    if HHGear^.dY < _0 then
         begin
-        Gear^.dX:= Gear^.X + int2hwFloat(LAND_WIDTH + 1024);
-        Gear^.dY:= int2hwFloat(256);
-        Gear^.X:= int2hwFloat(-LAND_WIDTH -1024);
-        Gear^.Y:= Gear^.Y + int2hwFloat(-256);
-        end
-    else
-        begin
-        Gear^.dX:= Gear^.X - int2hwFloat(LAND_WIDTH + 1024);
-        Gear^.dY:= int2hwFloat(256);
-        Gear^.X:= int2hwFloat(+LAND_WIDTH +1024);
-        Gear^.Y:= Gear^.Y + int2hwFloat(-256);
+        Gear^.dX:= HHGear^.dX;
+        Gear^.dY:= HHGear^.dY;
         end;
-    Gear^.State:= Gear^.State or gstAnimation or gstTmpFlag;
     Gear^.Timer:= 0;
     Gear^.doStep:= @doStepBirdyDisappear;
     CurAmmoGear:= nil;