hedgewars/uRandom.pas
changeset 527 e23490ce1f06
parent 431 79ac59673df3
child 915 33040b7695c0
--- a/hedgewars/uRandom.pas	Sun May 27 13:53:41 2007 +0000
+++ b/hedgewars/uRandom.pas	Sun May 27 17:33:06 2007 +0000
@@ -20,6 +20,7 @@
 interface
 uses uFloat;
 {$INCLUDE options.inc}
+{$INCLUDE proto.inc}
 
 procedure SetRandomSeed(Seed: shortstring);
 function  GetRandom: hwFloat; overload;
@@ -47,11 +48,11 @@
 
 if Length(Seed) > 54 then Seed:= copy(Seed, 1, 54); // not 55 to ensure we have odd numbers in cirbuf
 
-for i:= 1 to Length(Seed) do
-    cirbuf[i - 1]:= byte(Seed[i]) * (i * 2 + 7);
+for i:= 0 to Pred(Length(Seed)) do
+    cirbuf[i]:= byte(Seed[i + 1]);
 
 for i:= Length(Seed) to 54 do
-    cirbuf[i]:= i * 7 + 1;
+    cirbuf[i]:= $A98765 + (cNetProtoVersion * 2); // odd number
 
 for i:= 0 to 1023 do GetNext
 end;