Fix uGearsHandlersMess.pas changes lost in merge r1c02143bfe9c.
authorsheepluva
Tue, 21 Jan 2014 21:16:52 +0100
changeset 10038 0a5e651d494c
parent 10037 e8c7fe93f5dd
child 10039 58cf89284115
Fix uGearsHandlersMess.pas changes lost in merge r1c02143bfe9c. This seems to only include the drill rocket fixes ( re0dd66b2e73b and r8db0c56f7e2f ) as well as the initial cake push ( r8786d4ac9e0b )
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Tue Jan 21 22:04:40 2014 +0400
+++ b/hedgewars/uGearsHandlersMess.pas	Tue Jan 21 21:16:52 2014 +0100
@@ -3008,6 +3008,8 @@
 
     FollowGear := Gear;
 
+    Gear^.dY:= cMaxWindSpeed * 100;
+
     Gear^.doStep := @doStepCakeFall
 end;
 
@@ -3190,7 +3192,7 @@
 procedure doStepDrill(Gear: PGear);
 var
     t: PGearArray;
-    oldDx, oldDy: hwFloat;
+    oldX, oldY, oldDx, oldDy: hwFloat;
     t2: hwFloat;
 begin
     AllInactive := false;
@@ -3200,6 +3202,8 @@
 
     oldDx := Gear^.dX;
     oldDy := Gear^.dY;
+    oldX := Gear^.X;
+    oldY := Gear^.Y;
 
     doStepFallingGear(Gear);
 
@@ -3215,6 +3219,8 @@
         //hit
         Gear^.dX := oldDx;
         Gear^.dY := oldDy;
+        Gear^.X := oldX;
+        Gear^.Y := oldY;
 
         if GameTicks > Gear^.FlightTime then
             t := CheckGearsCollision(Gear)
@@ -3239,6 +3245,8 @@
             exit;
             end;
 
+        Gear^.X:= Gear^.X+Gear^.dX*4;
+        Gear^.Y:= Gear^.Y+Gear^.dY*4;
         Gear^.SoundChannel := LoopSound(sndDrillRocket);
         Gear^.doStep := @doStepDrillDrilling;