rising flakes will no longer fly forever [reviewed, cleaned up and committed by sheepluva]
authorKoBeWi <kobewi4e@gmail.com>
Fri, 14 Oct 2016 22:52:04 +0200
changeset 11868 60c8bb8bc1d7
parent 11867 f6d33710baff
child 11869 72b8c41b3f9c
rising flakes will no longer fly forever [reviewed, cleaned up and committed by sheepluva]
hedgewars/uVisualGearsHandlers.pas
--- a/hedgewars/uVisualGearsHandlers.pas	Mon Oct 03 14:10:25 2016 -0400
+++ b/hedgewars/uVisualGearsHandlers.pas	Fri Oct 14 22:52:04 2016 +0200
@@ -162,8 +162,14 @@
             X:= X - cScreenSpace;
             moved:= true
             end;
-            // if round(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + 25.0; // For if flag is set for flakes rising upwards?
-        if (Gear^.Layer = 2) and (round(Y) - 400 > LAND_HEIGHT) and (cGravityf >= 0) then
+
+        if round(Y) < (LAND_HEIGHT - 1024 - 75) then
+            begin
+            X:= cLeftScreenBorder + random(cScreenSpace);
+            Y:= Y+(1024 + 200 + random(50));
+            moved:= true
+            end
+        else if (Gear^.Layer = 2) and (round(Y) - 400 > LAND_HEIGHT) and (cGravityf >= 0) then
             begin
             X:= cLeftScreenBorder + random(cScreenSpace);
             Y:= Y-(1024 + 400 + random(50)); // TODO - configure in theme (jellies for example could use limited range)