hedgewars/uLand.pas
changeset 161 d8870bbf960e
parent 160 207f520b9e83
child 173 004493dd60e4
--- a/hedgewars/uLand.pas	Fri Sep 22 18:09:26 2006 +0000
+++ b/hedgewars/uLand.pas	Sat Sep 23 19:26:07 2006 +0000
@@ -470,12 +470,17 @@
      end;
 end;
 
+function SelectTemplate: integer;
+begin
+Result:= getrandom(Succ(High(EdgeTemplates)))
+end;
+
 procedure GenLandSurface;
 var tmpsurf: PSDL_Surface;
 begin
 WriteLnToConsole('Generating land...');
 
-GenBlank(EdgeTemplates[getrandom(Succ(High(EdgeTemplates)))]);
+GenBlank(EdgeTemplates[SelectTemplate]);
 
 AddProgress;
 with PixelFormat^ do
@@ -573,7 +578,7 @@
 var x, y, xx, yy, t, bit: integer;
 begin
 WriteLnToConsole('Generating preview...');
-GenBlank(EdgeTemplates[getrandom(Succ(High(EdgeTemplates)))]);
+GenBlank(EdgeTemplates[SelectTemplate]);
 
 for y:= 0 to 127 do
     for x:= 0 to 31 do