Changeset - r23248:ca7f30396636
[Not reviewed]
master
0 5 0
J0an Josep - 6 years ago 2019-01-14 23:09:04
juanjo.ng.83@gmail.com
Cleanup: [NPF] Remove unused parameter.
5 files changed with 9 insertions and 12 deletions:
0 comments (0 inline, 0 general)
src/pathfinder/npf/npf.cpp
Show inline comments
 
@@ -1130,7 +1130,7 @@ FindDepotData NPFRoadVehicleFindNearestD
 
	return FindDepotData(ftd.node.tile, ftd.best_path_dist);
 
}
 

	
 
Trackdir NPFRoadVehicleChooseTrack(const RoadVehicle *v, TileIndex tile, DiagDirection enterdir, TrackdirBits trackdirs, bool &path_found)
 
Trackdir NPFRoadVehicleChooseTrack(const RoadVehicle *v, TileIndex tile, DiagDirection enterdir, bool &path_found)
 
{
 
	NPFFindStationOrTileData fstd;
 

	
 
@@ -1152,7 +1152,7 @@ Trackdir NPFRoadVehicleChooseTrack(const
 

	
 
/*** Ships ***/
 

	
 
Track NPFShipChooseTrack(const Ship *v, TrackBits tracks, bool &path_found)
 
Track NPFShipChooseTrack(const Ship *v, bool &path_found)
 
{
 
	NPFFindStationOrTileData fstd;
 
	Trackdir trackdir = v->GetVehicleTrackdir();
 
@@ -1255,7 +1255,7 @@ bool NPFTrainCheckReverse(const Train *v
 
	return ftd.best_bird_dist == 0 && NPFGetFlag(&ftd.node, NPF_FLAG_REVERSE);
 
}
 

	
 
Track NPFTrainChooseTrack(const Train *v, TrackBits tracks, bool &path_found, bool reserve_track, struct PBSTileInfo *target)
 
Track NPFTrainChooseTrack(const Train *v, bool &path_found, bool reserve_track, struct PBSTileInfo *target)
 
{
 
	NPFFindStationOrTileData fstd;
 
	NPFFillWithOrderData(&fstd, v, reserve_track);
src/pathfinder/npf/npf_func.h
Show inline comments
 
@@ -32,20 +32,18 @@ FindDepotData NPFRoadVehicleFindNearestD
 
 * @param v         the RV that needs to find a path
 
 * @param tile      the tile to find the path from (should be next tile the RV is about to enter)
 
 * @param enterdir  diagonal direction which the RV will enter this new tile from
 
 * @param trackdirs available trackdirs on the new tile (to choose from)
 
 * @param path_found [out] Whether a path has been found (true) or has been guessed (false)
 
 * @return          the best trackdir for next turn or INVALID_TRACKDIR if the path could not be found
 
 */
 
Trackdir NPFRoadVehicleChooseTrack(const RoadVehicle *v, TileIndex tile, DiagDirection enterdir, TrackdirBits trackdirs, bool &path_found);
 
Trackdir NPFRoadVehicleChooseTrack(const RoadVehicle *v, TileIndex tile, DiagDirection enterdir, bool &path_found);
 

	
 
/**
 
 * Finds the best path for given ship using NPF.
 
 * @param v        the ship that needs to find a path
 
 * @param tracks   available tracks on the new tile (to choose from)
 
 * @param path_found [out] Whether a path has been found (true) or has been guessed (false)
 
 * @return         the best trackdir for next turn or INVALID_TRACK if the path could not be found
 
 */
 
Track NPFShipChooseTrack(const Ship *v, TrackBits tracks, bool &path_found);
 
Track NPFShipChooseTrack(const Ship *v, bool &path_found);
 

	
 
/**
 
 * Returns true if it is better to reverse the ship before leaving depot using NPF.
 
@@ -85,12 +83,11 @@ bool NPFTrainCheckReverse(const Train *v
 
/**
 
 * Finds the best path for given train using NPF.
 
 * @param v        the train that needs to find a path
 
 * @param tracks   available trackdirs on the new tile (to choose from)
 
 * @param path_found [out] Whether a path has been found (true) or has been guessed (false)
 
 * @param reserve_track indicates whether YAPF should try to reserve the found path
 
 * @param target   [out] the target tile of the reservation, free is set to true if path was reserved
 
 * @return         the best track for next turn
 
 */
 
Track NPFTrainChooseTrack(const Train *v, TrackBits tracks, bool &path_found, bool reserve_track, struct PBSTileInfo *target);
 
Track NPFTrainChooseTrack(const Train *v, bool &path_found, bool reserve_track, struct PBSTileInfo *target);
 

	
 
#endif /* NPF_FUNC_H */
src/roadveh_cmd.cpp
Show inline comments
 
@@ -958,7 +958,7 @@ static Trackdir RoadFindPathToDest(RoadV
 
	}
 

	
 
	switch (_settings_game.pf.pathfinder_for_roadvehs) {
 
		case VPF_NPF:  best_track = NPFRoadVehicleChooseTrack(v, tile, enterdir, trackdirs, path_found); break;
 
		case VPF_NPF:  best_track = NPFRoadVehicleChooseTrack(v, tile, enterdir, path_found); break;
 
		case VPF_YAPF: best_track = YapfRoadVehicleChooseTrack(v, tile, enterdir, trackdirs, path_found); break;
 

	
 
		default: NOT_REACHED();
src/ship_cmd.cpp
Show inline comments
 
@@ -491,7 +491,7 @@ static Track ChooseShipTrack(Ship *v, Ti
 

	
 
		switch (_settings_game.pf.pathfinder_for_ships) {
 
			case VPF_OPF: track = OPFShipChooseTrack(v, tile, enterdir, tracks, path_found); break;
 
			case VPF_NPF: track = NPFShipChooseTrack(v, tracks, path_found); break;
 
			case VPF_NPF: track = NPFShipChooseTrack(v, path_found); break;
 
			case VPF_YAPF: track = YapfShipChooseTrack(v, tile, enterdir, tracks, path_found, v->path); break;
 
			default: NOT_REACHED();
 
		}
src/train_cmd.cpp
Show inline comments
 
@@ -2313,7 +2313,7 @@ static const byte _initial_tile_subcoord
 
static Track DoTrainPathfind(const Train *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool &path_found, bool do_track_reservation, PBSTileInfo *dest)
 
{
 
	switch (_settings_game.pf.pathfinder_for_trains) {
 
		case VPF_NPF: return NPFTrainChooseTrack(v, tracks, path_found, do_track_reservation, dest);
 
		case VPF_NPF: return NPFTrainChooseTrack(v, path_found, do_track_reservation, dest);
 
		case VPF_YAPF: return YapfTrainChooseTrack(v, tile, enterdir, tracks, path_found, do_track_reservation, dest);
 

	
 
		default: NOT_REACHED();
0 comments (0 inline, 0 general)