src/clear_cmd.cpp
changeset 10439 50f056aa3024
parent 10438 51bff16a04c9
equal deleted inserted replaced
10438:51bff16a04c9 10439:50f056aa3024
   297 			uint j = GB(r, 16, 4) + 5;
   297 			uint j = GB(r, 16, 4) + 5;
   298 			for (;;) {
   298 			for (;;) {
   299 				TileIndex tile_new;
   299 				TileIndex tile_new;
   300 
   300 
   301 				SetClearGroundDensity(tile, CLEAR_ROCKS, 3);
   301 				SetClearGroundDensity(tile, CLEAR_ROCKS, 3);
       
   302 
   302 				do {
   303 				do {
   303 					if (--j == 0) goto get_out;
   304 					if (--j == 0) goto get_out;
   304 					tile_new = tile + TileOffsByDiagDir((DiagDirection)GB(Random(), 0, 2));
   305                     
       
   306                     TileIndexDiff dt = TileOffsByDiagDir((DiagDirection)GB(Random(), 0, 2));
       
   307 
       
   308                     if (!IsValidTile(tile + dt)) continue;
       
   309 
       
   310 					tile_new = tile + dt;
   305 				} while (!IsTileType(tile_new, MP_CLEAR) || IsClearGround(tile_new, CLEAR_DESERT));
   311 				} while (!IsTileType(tile_new, MP_CLEAR) || IsClearGround(tile_new, CLEAR_DESERT));
       
   312 
   306 				tile = tile_new;
   313 				tile = tile_new;
   307 			}
   314 			}
   308 get_out:;
   315 get_out:;
   309 		}
   316 		}
   310 	} while (i && --i);
   317 	} while (i && --i);