hedgewars/uLandObjects.pas
changeset 14282 6015b74eea55
parent 13833 664935d80668
child 14944 8b53cb1c0ada
equal deleted inserted replaced
14281:e754b516cc35 14282:6015b74eea55
   361 repeat
   361 repeat
   362     inc(y, 24);
   362     inc(y, 24);
   363     x1:= gX;
   363     x1:= gX;
   364     x2:= gX;
   364     x2:= gX;
   365 
   365 
   366     while (x1 > Longint(leftX)+150) and (CountNonZeroz(x1, y, girderHeight) = 0) do
   366     while (x1 > leftX+150) and (CountNonZeroz(x1, y, girderHeight) = 0) do
   367         dec(x1, 2);
   367         dec(x1, 2);
   368 
   368 
   369     i:= x1 - 12;
   369     i:= x1 - 12;
   370     repeat
   370     repeat
   371         k:= CountNonZeroz(x1, y, girderHeight);
   371         k:= CountNonZeroz(x1, y, girderHeight);
   372         dec(x1, 2)
   372         dec(x1, 2)
   373     until (x1 < Longint(leftX) + 100) or (k = 0) or (k = girderHeight) or (x1 < i);
   373     until (x1 < leftX + 100) or (k = 0) or (k = girderHeight) or (x1 < i);
   374 
   374 
   375     inc(x1, 2);
   375     inc(x1, 2);
   376     if k = girderHeight then
   376     if k = girderHeight then
   377         begin
   377         begin
   378         while (x2 < (LongInt(rightX) - 100)) and (CountNonZeroz(x2, y, girderHeight) = 0) do
   378         while (x2 < (rightX - 100)) and (CountNonZeroz(x2, y, girderHeight) = 0) do
   379             inc(x2, 2);
   379             inc(x2, 2);
   380         i:= x2 + 12;
   380         i:= x2 + 12;
   381         repeat
   381         repeat
   382         inc(x2, 2);
   382         inc(x2, 2);
   383         k:= CountNonZeroz(x2, y, girderHeight)
   383         k:= CountNonZeroz(x2, y, girderHeight)
   384         until (x2 >= (LongInt(rightX)-150)) or (k = 0) or (k = girderHeight) or (x2 > i) or (x2 - x1 >= 900);
   384         until (x2 >= (rightX-150)) or (k = 0) or (k = girderHeight) or (x2 > i) or (x2 - x1 >= 900);
   385 
   385 
   386         if (x2 < (LongInt(rightX) - 100)) and (k = girderHeight) and (x2 - x1 > 200) and (x2 - x1 < 900)
   386         if (x2 < (rightX - 100)) and (k = girderHeight) and (x2 - x1 > 200) and (x2 - x1 < 900)
   387         and (not CheckIntersect(x1 - 32, y - 64, x2 - x1 + 64, 144)) then
   387         and (not CheckIntersect(x1 - 32, y - 64, x2 - x1 + 64, 144)) then
   388                 break;
   388                 break;
   389         end;
   389         end;
   390 x1:= 0;
   390 x1:= 0;
   391 until y > (LAND_HEIGHT-125);
   391 until y > (LAND_HEIGHT-125);