hedgewars/uGearsUtils.pas
changeset 11478 8c95d5a4366c
parent 11477 e425a6eb9da3
child 11479 846a3b3a3d1c
equal deleted inserted replaced
11477:e425a6eb9da3 11478:8c95d5a4366c
   937             begin
   937             begin
   938             //AddFileLog('Trying to make a hole');
   938             //AddFileLog('Trying to make a hole');
   939             while (cnt < 1000) do
   939             while (cnt < 1000) do
   940                 begin
   940                 begin
   941                 inc(cnt);
   941                 inc(cnt);
   942                 x:= leftX+GetRandom(rightX-leftX-16)+8;
   942                 x:= leftX+GetRandom(rightX-leftX-32)+16;
   943                 y:= topY+GetRandom(LAND_HEIGHT-topY-16)+8;
   943                 y:= topY+GetRandom(LAND_HEIGHT-topY-32)+16;
   944                 if NoGearsToAvoid(x, y, 100, 100) then
   944                 if NoGearsToAvoid(x, y, 100 div max(1,cnt div 100), 100 div max(1,cnt div 100)) then
   945                     begin
   945                     begin
   946                     Gear^.State:= Gear^.State or gsttmpFlag;
   946                     Gear^.State:= Gear^.State or gsttmpFlag;
   947                     Gear^.X:= int2hwFloat(x);
   947                     Gear^.X:= int2hwFloat(x);
   948                     Gear^.Y:= int2hwFloat(y);
   948                     Gear^.Y:= int2hwFloat(y);
   949                     AddFileLog('Picked a spot for hog at coordinates (' + inttostr(hwRound(Gear^.X)) + ',' + inttostr(hwRound(Gear^.Y)) + ')');
   949                     AddFileLog('Picked a spot for hog at coordinates (' + inttostr(hwRound(Gear^.X)) + ',' + inttostr(hwRound(Gear^.Y)) + ')');