hedgewars/GSHandlers.inc
changeset 525 ae21b8e86dd9
parent 522 ca089787f59d
child 534 92fb2b0d5117
--- a/hedgewars/GSHandlers.inc	Sat May 26 20:22:07 2007 +0000
+++ b/hedgewars/GSHandlers.inc	Sat May 26 20:47:36 2007 +0000
@@ -1124,6 +1124,18 @@
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
+procedure doStepTeleportAfter(Gear: PGear);
+var HHGear: PGear;
+begin
+HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear;
+HHGear^.Y:= HHGear^.Y + HHGear^.dY;
+HHGear^.dY:= HHGear^.dY + cGravity;
+if TestCollisionYwithGear(HHGear, 1) then
+   begin
+   DeleteGear(Gear);
+   AfterAttack
+   end
+end;
 
 procedure doStepTeleport(Gear: PGear);
 var HHGear: PGear;
@@ -1143,10 +1155,10 @@
         end
    else begin
         DeleteCI(HHGear);
+        Gear^.doStep:= @doStepTeleportAfter;
         HHGear^.X:= int2hwFloat(TargetPoint.X);
         HHGear^.Y:= int2hwFloat(TargetPoint.Y);
-        DeleteGear(Gear);
-        AfterAttack
+        HHGear^.State:= HHGear^.State or gstFalling
         end;
 TargetPoint.X:= NoPointX
 end;