hedgewars/GSHandlers.inc
changeset 8030 165aeaaaf445
parent 8003 7d8bce524daf
child 8061 c08e9c3e0737
--- a/hedgewars/GSHandlers.inc	Wed Nov 14 22:27:05 2012 -0500
+++ b/hedgewars/GSHandlers.inc	Wed Nov 14 23:23:56 2012 -0500
@@ -1691,7 +1691,7 @@
         end
     else
         begin 
-        if (Gear^.Pos <> posCaseHealth) and (GameTicks and $3FF = 0) then // stir it up every second or so
+        if (Gear^.Pos <> posCaseHealth) and (GameTicks and $1FFF = 0) then // stir 'em up periodically
             begin
             gi := GearsList;
             while gi <> nil do
@@ -5143,6 +5143,7 @@
         begin
         with gi^ do CheckSum:= CheckSum xor X.round xor X.frac xor dX.round xor dX.frac xor Y.round xor Y.frac xor dY.round xor dY.frac;
         AddRandomness(CheckSum);
+        if gi^.Kind = gtGenericFaller then gi^.State:= gi^.State and not gstTmpFlag;
         gi := gi^.NextGear
         end;
     AddPickup(Gear^.Hedgehog^, a, Gear^.Power, hwRound(Gear^.X), hwRound(Gear^.Y));
@@ -5160,8 +5161,17 @@
         DeleteGear(Gear);
         exit
         end;
-    
-doStepFallingGear(Gear);
+if (Gear^.State and gstTmpFlag <> 0) or (GameTicks and $7 = 0) then
+    begin
+    doStepFallingGear(Gear);
+    if (Gear^.State and gstInvisible <> 0) and (GameTicks and $FF = 0) and ((hwRound(Gear^.X) < leftX) or (hwRound(Gear^.X) > rightX) or (hwRound(Gear^.Y) < topY)) then
+        begin
+        Gear^.X:= int2hwFloat(GetRandom(rightX-leftX)+leftX);
+        Gear^.Y:= int2hwFloat(GetRandom(LAND_HEIGHT-topY)+topY);
+        Gear^.dX:= _90-(GetRandomf*_360);
+        Gear^.dY:= _90-(GetRandomf*_360)
+        end;
+    end
 end;
 
 procedure doStepCreeper(Gear: PGear);