- Attempt to fix a crash while selecting 'Random' for map generation ios-revival
authorantonc27 <antonc27@mail.ru>
Mon, 14 Sep 2015 07:02:06 +0200
branchios-revival
changeset 11179 e1a098f950a9
parent 11166 9aad7f294864
child 11180 906c1878bc2c
- Attempt to fix a crash while selecting 'Random' for map generation Note 1: It occurs in BezierizeEdge procedure of uLandOutline while generating land preview Note 2: Crash fixed, but most previews are not generated correctly, e.g. it's a case for bordered map.
hedgewars/uLandGenTemplateBased.pas
--- a/hedgewars/uLandGenTemplateBased.pas	Sat Sep 12 05:46:59 2015 +0200
+++ b/hedgewars/uLandGenTemplateBased.pas	Mon Sep 14 07:02:06 2015 +0200
@@ -9,7 +9,7 @@
 var minDistance, dabDiv: LongInt; // different details size
 
 implementation
-uses uVariables, uConsts, uFloat, uLandUtils, uRandom, SDLh, math;
+uses uVariables, uTypes, uConsts, uFloat, uLandUtils, uRandom, SDLh, math;
 
 
 procedure SetPoints(var Template: TEdgeTemplate; var pa: TPixAr; fps: PPointArray);
@@ -327,6 +327,9 @@
         DivideEdges(Template.FillPointsCount, pa)
     until i = pa.Count;
 
+{$IFDEF IPHONEOS}
+    if GameType <> gmtLandPreview then
+{$ENDIF}
     // make it smooth
     BezierizeEdge(pa, _0_2);
 end;