File diff r25654:e264fd698eb2 → r25655:1030dcb7eb52
src/pathfinder/npf/npf.cpp
Show inline comments
 
@@ -178,7 +178,7 @@ static int32 NPFCalcStationOrTileHeurist
 
		dist = NPFDistanceTrack(from, to);
 
	}
 

	
 
	DEBUG(npf, 4, "Calculating H for: (%d, %d). Result: %d", TileX(current->tile), TileY(current->tile), dist);
 
	Debug(npf, 4, "Calculating H for: ({}, {}). Result: {}", TileX(current->tile), TileY(current->tile), dist);
 

	
 
	if (dist < ftd->best_bird_dist) {
 
		ftd->best_bird_dist = dist;
 
@@ -198,7 +198,7 @@ static void NPFFillTrackdirChoice(AyStar
 
		/* This is a first order decision, so we'd better save the
 
		 * direction we chose */
 
		current->user_data[NPF_TRACKDIR_CHOICE] = trackdir;
 
		DEBUG(npf, 6, "Saving trackdir: 0x%X", trackdir);
 
		Debug(npf, 6, "Saving trackdir: 0x{:X}", trackdir);
 
	} else {
 
		/* We've already made the decision, so just save our parent's decision */
 
		current->user_data[NPF_TRACKDIR_CHOICE] = parent->path.node.user_data[NPF_TRACKDIR_CHOICE];
 
@@ -394,7 +394,7 @@ static int32 NPFRoadPathCost(AyStar *as,
 
	}
 

	
 
	NPFMarkTile(tile);
 
	DEBUG(npf, 4, "Calculating G for: (%d, %d). Result: %d", TileX(current->tile), TileY(current->tile), cost);
 
	Debug(npf, 4, "Calculating G for: ({}, {}). Result: {}", TileX(current->tile), TileY(current->tile), cost);
 
	return cost;
 
}
 

	
 
@@ -546,7 +546,7 @@ static int32 NPFRailPathCost(AyStar *as,
 
	cost += NPFReservedTrackCost(current);
 

	
 
	NPFMarkTile(tile);
 
	DEBUG(npf, 4, "Calculating G for: (%d, %d). Result: %d", TileX(current->tile), TileY(current->tile), cost);
 
	Debug(npf, 4, "Calculating G for: ({}, {}). Result: {}", TileX(current->tile), TileY(current->tile), cost);
 
	return cost;
 
}
 

	
 
@@ -865,7 +865,7 @@ static TrackdirBits GetDriveableTrackdir
 
		}
 
	}
 

	
 
	DEBUG(npf, 4, "Next node: (%d, %d) [%d], possible trackdirs: 0x%X", TileX(dst_tile), TileY(dst_tile), dst_tile, trackdirbits);
 
	Debug(npf, 4, "Next node: ({}, {}) [{}], possible trackdirs: 0x{:X}", TileX(dst_tile), TileY(dst_tile), dst_tile, trackdirbits);
 

	
 
	/* Select only trackdirs we can reach from our current trackdir */
 
	trackdirbits &= TrackdirReachesTrackdirs(src_trackdir);
 
@@ -875,7 +875,7 @@ static TrackdirBits GetDriveableTrackdir
 
		trackdirbits &= ~TrackdirCrossesTrackdirs(src_trackdir);
 
	}
 

	
 
	DEBUG(npf, 6, "After filtering: (%d, %d), possible trackdirs: 0x%X", TileX(dst_tile), TileY(dst_tile), trackdirbits);
 
	Debug(npf, 6, "After filtering: ({}, {}), possible trackdirs: 0x{:X}", TileX(dst_tile), TileY(dst_tile), trackdirbits);
 

	
 
	return trackdirbits;
 
}
 
@@ -901,7 +901,7 @@ static void NPFFollowTrack(AyStar *aysta
 

	
 
	/* Initialize to 0, so we can jump out (return) somewhere an have no neighbours */
 
	aystar->num_neighbours = 0;
 
	DEBUG(npf, 4, "Expanding: (%d, %d, %d) [%d]", TileX(src_tile), TileY(src_tile), src_trackdir, src_tile);
 
	Debug(npf, 4, "Expanding: ({}, {}, {}) [{}]", TileX(src_tile), TileY(src_tile), src_trackdir, src_tile);
 

	
 
	/* We want to determine the tile we arrive, and which choices we have there */
 
	TileIndex dst_tile;
 
@@ -966,7 +966,7 @@ static void NPFFollowTrack(AyStar *aysta
 
	uint i = 0;
 
	while (trackdirbits != TRACKDIR_BIT_NONE) {
 
		Trackdir dst_trackdir = RemoveFirstTrackdir(&trackdirbits);
 
		DEBUG(npf, 5, "Expanded into trackdir: %d, remaining trackdirs: 0x%X", dst_trackdir, trackdirbits);
 
		Debug(npf, 5, "Expanded into trackdir: {}, remaining trackdirs: 0x{:X}", dst_trackdir, trackdirbits);
 

	
 
		/* Tile with signals? */
 
		if (IsTileType(dst_tile, MP_RAILWAY) && GetRailTileType(dst_tile) == RAIL_TILE_SIGNALS) {
 
@@ -1050,10 +1050,10 @@ static NPFFoundTargetData NPFRouteIntern
 

	
 
	if (result.best_bird_dist != 0) {
 
		if (target != nullptr) {
 
			DEBUG(npf, 1, "Could not find route to tile 0x%X from 0x%X.", target->dest_coords, start1->tile);
 
			Debug(npf, 1, "Could not find route to tile 0x{:X} from 0x{:X}.", target->dest_coords, start1->tile);
 
		} else {
 
			/* Assumption: target == nullptr, so we are looking for a depot */
 
			DEBUG(npf, 1, "Could not find route to a depot from tile 0x%X.", start1->tile);
 
			Debug(npf, 1, "Could not find route to a depot from tile 0x{:X}.", start1->tile);
 
		}
 

	
 
	}