Remove: OPF

This commit is contained in:
Charles Pigott
2019-02-18 23:55:45 +00:00
committed by PeterN
parent c7b5f34138
commit fe448a2616
18 changed files with 10 additions and 328 deletions

View File

@@ -29,7 +29,6 @@
#include "sound_func.h"
#include "ai/ai.hpp"
#include "game/game.hpp"
#include "pathfinder/opf/opf_ship.h"
#include "engine_base.h"
#include "company_base.h"
#include "tunnelbridge_map.h"
@@ -178,7 +177,6 @@ static void CheckIfShipNeedsService(Vehicle *v)
uint max_distance;
switch (_settings_game.pf.pathfinder_for_ships) {
case VPF_OPF: max_distance = 12; break;
case VPF_NPF: max_distance = _settings_game.pf.npf.maximum_go_to_depot_penalty / NPF_TILE_LENGTH; break;
case VPF_YAPF: max_distance = _settings_game.pf.yapf.maximum_go_to_depot_penalty / YAPF_TILE_LENGTH; break;
default: NOT_REACHED();
@@ -369,9 +367,7 @@ static bool CheckShipLeaveDepot(Ship *v)
if (north_tracks && south_tracks) {
/* Ask pathfinder for best direction */
bool reverse = false;
bool path_found;
switch (_settings_game.pf.pathfinder_for_ships) {
case VPF_OPF: reverse = OPFShipChooseTrack(v, north_neighbour, north_dir, north_tracks, path_found) == INVALID_TRACK; break; // OPF always allows reversing
case VPF_NPF: reverse = NPFShipCheckReverse(v); break;
case VPF_YAPF: reverse = YapfShipCheckReverse(v); break;
default: NOT_REACHED();
@@ -492,7 +488,6 @@ static Track ChooseShipTrack(Ship *v, TileIndex tile, DiagDirection enterdir, Tr
}
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, path_found); break;
case VPF_YAPF: track = YapfShipChooseTrack(v, tile, enterdir, tracks, path_found, v->path); break;
default: NOT_REACHED();
@@ -514,8 +509,7 @@ static inline TrackBits GetAvailShipTracks(TileIndex tile, DiagDirection dir, Tr
{
TrackBits tracks = GetTileShipTrackStatus(tile) & DiagdirReachesTracks(dir);
/* Do not remove 90 degree turns for OPF, as it isn't able to find paths taking it into account. */
if (_settings_game.pf.forbid_90_deg && _settings_game.pf.pathfinder_for_ships != VPF_OPF) tracks &= ~TrackCrossesTracks(TrackdirToTrack(trackdir));
if (_settings_game.pf.forbid_90_deg) tracks &= ~TrackCrossesTracks(TrackdirToTrack(trackdir));
return tracks;
}