(svn r13325) -Codechange: split the client-side only settings from the settings stored in the savegame so there is no need to have a duplicate copy of it for new games.
This commit is contained in:
@@ -53,7 +53,7 @@ public:
|
||||
protected:
|
||||
Node* m_pBestDestNode; ///< pointer to the destination node found at last round
|
||||
Node* m_pBestIntermediateNode; ///< here should be node closest to the destination if path not found
|
||||
const YAPFSettings *m_settings; ///< current settings (_settings.yapf)
|
||||
const YAPFSettings *m_settings; ///< current settings (_settings_game.yapf)
|
||||
int m_max_search_nodes; ///< maximum number of nodes we are allowed to visit before we give up
|
||||
const Vehicle* m_veh; ///< vehicle that we are trying to drive
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
FORCEINLINE CYapfBaseT()
|
||||
: m_pBestDestNode(NULL)
|
||||
, m_pBestIntermediateNode(NULL)
|
||||
, m_settings(&_settings.pf.yapf)
|
||||
, m_settings(&_settings_game.pf.yapf)
|
||||
, m_max_search_nodes(PfGetSettings().max_search_nodes)
|
||||
, m_veh(NULL)
|
||||
, m_stats_cost_calcs(0)
|
||||
|
@@ -254,7 +254,7 @@ Trackdir YapfChooseRailTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir,
|
||||
PfnChooseRailTrack pfnChooseRailTrack = &CYapfRail1::stChooseRailTrack;
|
||||
|
||||
// check if non-default YAPF type needed
|
||||
if (_settings.pf.forbid_90_deg) {
|
||||
if (_settings_game.pf.forbid_90_deg) {
|
||||
pfnChooseRailTrack = &CYapfRail2::stChooseRailTrack; // Trackdir, forbid 90-deg
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ bool YapfCheckReverseTrain(Vehicle* v)
|
||||
PfnCheckReverseTrain pfnCheckReverseTrain = CYapfRail1::stCheckReverseTrain;
|
||||
|
||||
// check if non-default YAPF type needed
|
||||
if (_settings.pf.forbid_90_deg) {
|
||||
if (_settings_game.pf.forbid_90_deg) {
|
||||
pfnCheckReverseTrain = &CYapfRail2::stCheckReverseTrain; // Trackdir, forbid 90-deg
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ bool YapfFindNearestRailDepotTwoWay(Vehicle *v, int max_distance, int reverse_pe
|
||||
PfnFindNearestDepotTwoWay pfnFindNearestDepotTwoWay = &CYapfAnyDepotRail1::stFindNearestDepotTwoWay;
|
||||
|
||||
// check if non-default YAPF type needed
|
||||
if (_settings.pf.forbid_90_deg) {
|
||||
if (_settings_game.pf.forbid_90_deg) {
|
||||
pfnFindNearestDepotTwoWay = &CYapfAnyDepotRail2::stFindNearestDepotTwoWay; // Trackdir, forbid 90-deg
|
||||
}
|
||||
|
||||
|
@@ -407,7 +407,7 @@ Trackdir YapfChooseRoadTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir)
|
||||
PfnChooseRoadTrack pfnChooseRoadTrack = &CYapfRoad2::stChooseRoadTrack; // default: ExitDir, allow 90-deg
|
||||
|
||||
// check if non-default YAPF type should be used
|
||||
if (_settings.pf.yapf.disable_node_optimization)
|
||||
if (_settings_game.pf.yapf.disable_node_optimization)
|
||||
pfnChooseRoadTrack = &CYapfRoad1::stChooseRoadTrack; // Trackdir, allow 90-deg
|
||||
|
||||
Trackdir td_ret = pfnChooseRoadTrack(v, tile, enterdir);
|
||||
@@ -421,7 +421,7 @@ uint YapfRoadVehDistanceToTile(const Vehicle* v, TileIndex tile)
|
||||
PfnDistanceToTile pfnDistanceToTile = &CYapfRoad2::stDistanceToTile; // default: ExitDir, allow 90-deg
|
||||
|
||||
// check if non-default YAPF type should be used
|
||||
if (_settings.pf.yapf.disable_node_optimization)
|
||||
if (_settings_game.pf.yapf.disable_node_optimization)
|
||||
pfnDistanceToTile = &CYapfRoad1::stDistanceToTile; // Trackdir, allow 90-deg
|
||||
|
||||
// measure distance in YAPF units
|
||||
@@ -450,7 +450,7 @@ Depot* YapfFindNearestRoadDepot(const Vehicle *v)
|
||||
PfnFindNearestDepot pfnFindNearestDepot = &CYapfRoadAnyDepot2::stFindNearestDepot;
|
||||
|
||||
// check if non-default YAPF type should be used
|
||||
if (_settings.pf.yapf.disable_node_optimization)
|
||||
if (_settings_game.pf.yapf.disable_node_optimization)
|
||||
pfnFindNearestDepot = &CYapfRoadAnyDepot1::stFindNearestDepot; // Trackdir, allow 90-deg
|
||||
|
||||
Depot* ret = pfnFindNearestDepot(v, tile, trackdir);
|
||||
|
@@ -154,9 +154,9 @@ Trackdir YapfChooseShipTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir,
|
||||
PfnChooseShipTrack pfnChooseShipTrack = CYapfShip2::ChooseShipTrack; // default: ExitDir, allow 90-deg
|
||||
|
||||
// check if non-default YAPF type needed
|
||||
if (_settings.pf.forbid_90_deg)
|
||||
if (_settings_game.pf.forbid_90_deg)
|
||||
pfnChooseShipTrack = &CYapfShip3::ChooseShipTrack; // Trackdir, forbid 90-deg
|
||||
else if (_settings.pf.yapf.disable_node_optimization)
|
||||
else if (_settings_game.pf.yapf.disable_node_optimization)
|
||||
pfnChooseShipTrack = &CYapfShip1::ChooseShipTrack; // Trackdir, allow 90-deg
|
||||
|
||||
Trackdir td_ret = pfnChooseShipTrack(v, tile, enterdir, tracks);
|
||||
|
Reference in New Issue
Block a user