pick random x/y prior to addgear (as generic faller does) to avoid random numbers picked out of order
authornemo
Tue, 07 Jan 2014 13:56:03 -0500
changeset 9951 b776cd642d0b
parent 9948 91a43c79cd4b
child 9953 fc33ce04502c
pick random x/y prior to addgear (as generic faller does) to avoid random numbers picked out of order
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Sat Jan 04 23:30:52 2014 +0400
+++ b/hedgewars/uGears.pas	Tue Jan 07 13:56:03 2014 -0500
@@ -626,7 +626,11 @@
 
 if (not hasBorder) and cSnow then
     for i:= vobCount * Longword(max(LAND_WIDTH,4096)) div 2048 downto 1 do
-        AddGear(LongInt(GetRandom(snowRight - snowLeft)) + snowLeft, LAND_HEIGHT + LongInt(GetRandom(750)) - 1300, gtFlake, 0, _0, _0, 0);
+        begin
+        rx:=GetRandom(snowRight - snowLeft);
+        ry:=GetRandom(750);
+        AddGear(rx + snowLeft, LAND_HEIGHT + ry - 1300, gtFlake, 0, _0, _0, 0)
+        end
 end;
 
 procedure AssignHHCoords;