Fix engine PRNG (accidentally deleted a line)
authorunc0rr
Sun, 27 Aug 2006 13:47:30 +0000
changeset 130 19e3c16fb9f0
parent 129 313f3d0ee7fa
child 131 482f78c595ec
Fix engine PRNG (accidentally deleted a line)
hedgewars/uRandom.pas
--- a/hedgewars/uRandom.pas	Sun Aug 27 13:38:05 2006 +0000
+++ b/hedgewars/uRandom.pas	Sun Aug 27 13:47:30 2006 +0000
@@ -40,7 +40,6 @@
 function  GetRandom(m: LongWord): LongWord; overload;
 
 implementation
-uses uMisc;
 var cirbuf: array[0..63] of Longword;
     n: byte = 54;
 
@@ -51,7 +50,6 @@
            (cirbuf[(n + 40) and $3F] +           {n - 24 mod 64}
             cirbuf[(n +  9) and $3F])            {n - 55 mod 64}
             and $7FFFFFFF;                       {mod 2^31}
-            
 Result:= cirbuf[n]
 end;
 
@@ -64,7 +62,9 @@
     cirbuf[i]:= byte(Seed[i + 1]) * (i + 1);
 
 for i:= Length(Seed) to 54 do
-    cirbuf[i]:= i * 7 + 1
+    cirbuf[i]:= i * 7 + 1;
+
+for i:= 0 to 1023 do GetNext
 end;
 
 function GetRandom: Double;