hedgewars/uLandGenTemplateBased.pas
changeset 10502 a888e649bea2
parent 10499 0d8016085108
child 10510 9329dab04490
equal deleted inserted replaced
10501:89e8d6d05dfa 10502:a888e649bea2
   147         d:= DistanceI(mp.x - leftX - mapBorderMargin, mp.y - iy).Round;
   147         d:= DistanceI(mp.x - leftX - mapBorderMargin, mp.y - iy).Round;
   148         t1:= a * (mp.x - mapBorderMargin) + b * (mp.y - iy);
   148         t1:= a * (mp.x - mapBorderMargin) + b * (mp.y - iy);
   149         if t1 > 0 then distL:= d else distR:= d;
   149         if t1 > 0 then distL:= d else distR:= d;
   150 
   150 
   151         // right border
   151         // right border
   152         iy:= (rightX - mapBorderMargin - mp.x) * b div a + mp.y;
   152         iy:= (LongInt(rightX) - mapBorderMargin - mp.x) * b div a + mp.y;
   153         d:= DistanceI(mp.x - rightX + mapBorderMargin, mp.y - iy).Round;
   153         d:= DistanceI(mp.x - rightX + mapBorderMargin, mp.y - iy).Round;
   154         if t1 > 0 then distR:= d else distL:= d;
   154         if t1 > 0 then distR:= d else distL:= d;
   155     end else
   155     end else
   156     begin
   156     begin
   157         distL:= LAND_WIDTH + LAND_HEIGHT;
   157         distL:= LAND_WIDTH + LAND_HEIGHT;