src/ai/default/default.cpp
changeset 9107 3e57b96e98f2
parent 9098 4fb97a0770f0
child 9110 55864e1fc263
equal deleted inserted replaced
9106:604b69ee3879 9107:3e57b96e98f2
  1900 	TileIndex tile2;
  1900 	TileIndex tile2;
  1901 	int count;
  1901 	int count;
  1902 	bool flag;
  1902 	bool flag;
  1903 };
  1903 };
  1904 
  1904 
  1905 static bool AiEnumFollowTrack(TileIndex tile, AiRailPathFindData *a, int track, uint length, byte *state)
  1905 static bool AiEnumFollowTrack(TileIndex tile, AiRailPathFindData *a, int track, uint length)
  1906 {
  1906 {
  1907 	if (a->flag) return true;
  1907 	if (a->flag) return true;
  1908 
  1908 
  1909 	if (length > 20 || tile == a->tile) {
  1909 	if (length > 20 || tile == a->tile) {
  1910 		a->flag = true;
  1910 		a->flag = true;
  2846 
  2846 
  2847 	return better;
  2847 	return better;
  2848 }
  2848 }
  2849 
  2849 
  2850 
  2850 
  2851 static bool AiEnumFollowRoad(TileIndex tile, AiRoadEnum *a, int track, uint length, byte *state)
  2851 static bool AiEnumFollowRoad(TileIndex tile, AiRoadEnum *a, int track, uint length)
  2852 {
  2852 {
  2853 	uint dist = DistanceManhattan(tile, a->dest);
  2853 	uint dist = DistanceManhattan(tile, a->dest);
  2854 
  2854 
  2855 	if (dist <= a->best_dist) {
  2855 	if (dist <= a->best_dist) {
  2856 		TileIndex tile2 = TILE_MASK(tile + TileOffsByDiagDir(_dir_by_track[track]));
  2856 		TileIndex tile2 = TILE_MASK(tile + TileOffsByDiagDir(_dir_by_track[track]));