anchor.diff:  
   
   //todo: Rewrite into controlled recursion to avoid StackOverflows
  +//@Krom: Stackoverflow usually occurs because keeping mountain walkable with stonemining is
  +//       sometimes impossible to solve when considering CanElevate (houses near stone).
  +//       So changing recursion to iteration would just give us an infinite loop in that case :(
  +//       I've added aIgnoreCanElevate for stonemining only, which means land under houses
  +//       gets elevated but stops crashes (tested on multiple r5503 crash reports) since
  +//       now it is possible to keep all tiles walkable by repeatedly flattening.
  +//       I can't think of a flattening algo that maintains walkability AND CanElevate constraint.
  +//       It needs major rethinking, rewriting recursion won't solve it.
   //Interpolate between 12 vertices surrounding this tile (X and Y, no diagonals)
   //Also it is FlattenTerrain duty to preserve walkability if there are units standing
  -procedure TKMTerrain.FlattenTerrain(Loc: TKMPoint; aUpdateWalkConnects: Boolean = True);
  +//aIgnoreCanElevate ignores CanElevate constraint which prevents crashes during stonemining (hacky)
  +procedure TKMTerrain.FlattenTerrain(Loc: TKMPoint; aUpdateWalkConnects: Boolean = True; aIgnoreCanElevate: Boolean = False);
     //If tiles with units standing on them become unwalkable we should try to fix them
     procedure EnsureWalkable(aX,aY: Word);
     begin
  
positive.code:     function CanWalkDiagonaly(const aFrom: TKMPoint; bX, bY: SmallInt): Boolean;
  
      function TopHill: Byte;
      procedure FlattenTerrain(Loc: TKMPoint; aUpdateWalkConnects: Boolean=true); overload;
      procedure FlattenTerrain(LocList: TKMPointList); overload;
  
      function ConvertCursorToMapCoord(inX,inY:single): Single;
  
negative.code:     else      Exit;
    end;
  
    FlattenTerrain(Loc, True, True); //Ignore canElevate since it can prevent stonehill from being still walkable and cause a crash
  end;
  
  
  