hedgewars/uLand.pas
changeset 15015 5d8068ee16fc
parent 14423 0281b80d366c
child 15144 adf6f9be8113
--- a/hedgewars/uLand.pas	Sun May 19 11:26:36 2019 +0200
+++ b/hedgewars/uLand.pas	Sun May 19 21:14:53 2019 +0200
@@ -285,10 +285,22 @@
 
 procedure GenDrawnMap;
 begin
+    if (cFeatureSize <= 6) then
+        MaxHedgehogs:= 6 + (cFeatureSize-1) * 2
+    else if (cFeatureSize < 11) then
+        MaxHedgehogs:= 16 + (cFeatureSize-6) * 4
+    else if (cFeatureSize = 11) then
+        MaxHedgehogs:= 48
+    else if (cFeatureSize = 12) then
+        MaxHedgehogs:= 64
+    else
+        MaxHedgehogs:= cMaxHHs;
+
+    if GameType = gmtLandPreview then
+        cFeatureSize:= 3;
     ResizeLand((4096 * max(min(cFeatureSize,24),3)) div 12, (2048 * max(min(cFeatureSize,24),3)) div 12);
     uLandPainted.Draw;
 
-    MaxHedgehogs:= 64;
     hasGirders:= true;
     playHeight:= LAND_HEIGHT;
     playWidth:= LAND_WIDTH;
@@ -886,7 +898,7 @@
         mgRandom: GenTemplated(EdgeTemplates[SelectTemplate]);
         mgMaze: begin ResizeLand(4096,2048); GenMaze; end;
         mgPerlin: begin ResizeLand(4096,2048); GenPerlin; end;
-        mgDrawn: begin cFeatureSize:= 3;GenDrawnMap; end;
+        mgDrawn: begin GenDrawnMap; end;
         mgForts: MakeFortsPreview();
     else
         OutError('Unknown mapgen', true);
@@ -945,7 +957,7 @@
         mgRandom: GenTemplated(EdgeTemplates[SelectTemplate]);
         mgMaze: begin ResizeLand(4096,2048); GenMaze; end;
         mgPerlin: begin ResizeLand(4096,2048); GenPerlin; end;
-        mgDrawn: begin cFeatureSize:= 3;GenDrawnMap; end;
+        mgDrawn: begin GenDrawnMap; end;
         mgForts: MakeFortsPreview;
     else
         OutError('Unknown mapgen', true);