mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-16 00:42:45 +01:00
Remove: NPF and pathfinder change settings
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
#include "articulated_vehicles.h"
|
||||
#include "command_func.h"
|
||||
#include "error_func.h"
|
||||
#include "pathfinder/npf/npf_func.h"
|
||||
#include "pathfinder/yapf/yapf.hpp"
|
||||
#include "news_func.h"
|
||||
#include "company_func.h"
|
||||
@@ -2171,12 +2170,7 @@ static FindDepotData FindClosestTrainDepot(Train *v, int max_distance)
|
||||
PBSTileInfo origin = FollowTrainReservation(v);
|
||||
if (IsRailDepotTile(origin.tile)) return FindDepotData(origin.tile, 0);
|
||||
|
||||
switch (_settings_game.pf.pathfinder_for_trains) {
|
||||
case VPF_NPF: return NPFTrainFindNearestDepot(v, max_distance);
|
||||
case VPF_YAPF: return YapfTrainFindNearestDepot(v, max_distance);
|
||||
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
return YapfTrainFindNearestDepot(v, max_distance);
|
||||
}
|
||||
|
||||
ClosestDepot Train::FindClosestDepot()
|
||||
@@ -2473,13 +2467,7 @@ static const uint8_t _initial_tile_subcoord[6][4][3] = {
|
||||
static Track DoTrainPathfind(const Train *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool &path_found, bool do_track_reservation, PBSTileInfo *dest, TileIndex *final_dest)
|
||||
{
|
||||
if (final_dest != nullptr) *final_dest = INVALID_TILE;
|
||||
|
||||
switch (_settings_game.pf.pathfinder_for_trains) {
|
||||
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, final_dest);
|
||||
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
return YapfTrainChooseTrack(v, tile, enterdir, tracks, path_found, do_track_reservation, dest, final_dest);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2581,12 +2569,7 @@ static PBSTileInfo ExtendTrainReservation(const Train *v, TrackBits *new_tracks,
|
||||
*/
|
||||
static bool TryReserveSafeTrack(const Train *v, TileIndex tile, Trackdir td, bool override_railtype)
|
||||
{
|
||||
switch (_settings_game.pf.pathfinder_for_trains) {
|
||||
case VPF_NPF: return NPFTrainFindNearestSafeTile(v, tile, td, override_railtype);
|
||||
case VPF_YAPF: return YapfTrainFindNearestSafeTile(v, tile, td, override_railtype);
|
||||
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
return YapfTrainFindNearestSafeTile(v, tile, td, override_railtype);
|
||||
}
|
||||
|
||||
/** This class will save the current order of a vehicle and restore it on destruction. */
|
||||
@@ -2934,12 +2917,7 @@ static bool CheckReverseTrain(const Train *v)
|
||||
|
||||
assert(v->track != TRACK_BIT_NONE);
|
||||
|
||||
switch (_settings_game.pf.pathfinder_for_trains) {
|
||||
case VPF_NPF: return NPFTrainCheckReverse(v);
|
||||
case VPF_YAPF: return YapfTrainCheckReverse(v);
|
||||
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
return YapfTrainCheckReverse(v);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4142,12 +4120,7 @@ static void CheckIfTrainNeedsService(Train *v)
|
||||
return;
|
||||
}
|
||||
|
||||
uint max_penalty;
|
||||
switch (_settings_game.pf.pathfinder_for_trains) {
|
||||
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 tfdd = FindClosestTrainDepot(v, max_penalty);
|
||||
/* Only go to the depot if it is not too far out of our way. */
|
||||
|
||||
Reference in New Issue
Block a user