Burn a random number in the override. Make sure cirbuf is reset.
authornemo
Wed, 22 Aug 2012 11:42:42 -0400
changeset 7575 f415b3e0f3b9
parent 7573 364cd923db43
child 7577 bdbb072b38b9
Burn a random number in the override. Make sure cirbuf is reset.
hedgewars/uGears.pas
hedgewars/uLand.pas
hedgewars/uRandom.pas
--- a/hedgewars/uGears.pas	Tue Aug 21 21:46:05 2012 -0400
+++ b/hedgewars/uGears.pas	Wed Aug 22 11:42:42 2012 -0400
@@ -641,7 +641,8 @@
 if (GameFlags and gfArtillery) <> 0 then
     cArtillery:= true;
 for i:= GetRandom(10)+30 downto 0 do
-    begin                                                                                                                                       rx:= GetRandom(rightX-leftX)+leftX;
+    begin
+    rx:= GetRandom(rightX-leftX)+leftX;
     ry:= GetRandom(LAND_HEIGHT-topY)+topY;
     rdx:= _90-(GetRandomf*_360);
     rdy:= _90-(GetRandomf*_360);
--- a/hedgewars/uLand.pas	Tue Aug 21 21:46:05 2012 -0400
+++ b/hedgewars/uLand.pas	Wed Aug 22 11:42:42 2012 -0400
@@ -285,7 +285,10 @@
         4: SelectTemplate:= CavernTemplates[getrandom(Succ(High(CavernTemplates)))];
         5: SelectTemplate:= WackyTemplates[getrandom(Succ(High(WackyTemplates)))];
 // For lua only!
-        6: SelectTemplate:= min(max(LuaTemplateNumber,0),High(EdgeTemplates));
+        6: begin
+           SelectTemplate:= min(max(LuaTemplateNumber,0),High(EdgeTemplates));
+           GetRandom(2) // burn 1
+           end;
     end;
 
     WriteLnToConsole('Selected template #'+inttostr(SelectTemplate)+' using filter #'+inttostr(cTemplateFilter));
--- a/hedgewars/uRandom.pas	Tue Aug 21 21:46:05 2012 -0400
+++ b/hedgewars/uRandom.pas	Wed Aug 22 11:42:42 2012 -0400
@@ -65,7 +65,7 @@
 procedure SetRandomSeed(Seed: shortstring);
 var i: Longword;
 begin
-n:= 54;
+initModule;
 
 if Length(Seed) > 54 then
     Seed:= copy(Seed, 1, 54); // not 55 to ensure we have odd numbers in cirbuf