1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-27 14:14:27 +01:00

Remove: NPF and pathfinder change settings

This commit is contained in:
merni-ns
2024-03-02 18:40:00 +05:30
committed by Kuhnovic
parent a5c2543efc
commit 55a7c59d13
18 changed files with 21 additions and 1840 deletions

View File

@@ -12,7 +12,6 @@
#include "command_func.h"
#include "error_func.h"
#include "news_func.h"
#include "pathfinder/npf/npf_func.h"
#include "station_base.h"
#include "company_func.h"
#include "articulated_vehicles.h"
@@ -342,12 +341,7 @@ static FindDepotData FindClosestRoadDepot(const RoadVehicle *v, int max_distance
{
if (IsRoadDepotTile(v->tile)) return FindDepotData(v->tile, 0);
switch (_settings_game.pf.pathfinder_for_roadvehs) {
case VPF_NPF: return NPFRoadVehicleFindNearestDepot(v, max_distance);
case VPF_YAPF: return YapfRoadVehicleFindNearestDepot(v, max_distance);
default: NOT_REACHED();
}
return YapfRoadVehicleFindNearestDepot(v, max_distance);
}
ClosestDepot RoadVehicle::FindClosestDepot()
@@ -989,12 +983,8 @@ static Trackdir RoadFindPathToDest(RoadVehicle *v, TileIndex tile, DiagDirection
}
}
switch (_settings_game.pf.pathfinder_for_roadvehs) {
case VPF_NPF: best_track = NPFRoadVehicleChooseTrack(v, tile, enterdir, path_found); break;
case VPF_YAPF: best_track = YapfRoadVehicleChooseTrack(v, tile, enterdir, trackdirs, path_found, v->path); break;
best_track = YapfRoadVehicleChooseTrack(v, tile, enterdir, trackdirs, path_found, v->path);
default: NOT_REACHED();
}
v->HandlePathfindingResult(path_found);
found_best_track:;
@@ -1683,12 +1673,7 @@ static void CheckIfRoadVehNeedsService(RoadVehicle *v)
return;
}
uint max_penalty;
switch (_settings_game.pf.pathfinder_for_roadvehs) {
case VPF_NPF: max_penalty = _settings_game.pf.npf.maximum_go_to_depot_penalty; break;
case VPF_YAPF: max_penalty = _settings_game.pf.yapf.maximum_go_to_depot_penalty; break;
default: NOT_REACHED();
}
uint max_penalty = _settings_game.pf.yapf.maximum_go_to_depot_penalty;
FindDepotData rfdd = FindClosestRoadDepot(v, max_penalty);
/* Only go to the depot if it is not too far out of our way. */