summaryrefslogtreecommitdiff
path: root/src/yapf
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-29 15:13:28 +0000
committerrubidium <rubidium@openttd.org>2008-05-29 15:13:28 +0000
commite7a501100a242640d25c21627ec67e75f9645043 (patch)
tree59059f0a1aba0794fa770e8c9a19312e4ce300af /src/yapf
parent48e20d801221888a1b8b6a4ab8288becad4b954b (diff)
downloadopenttd-e7a501100a242640d25c21627ec67e75f9645043.tar.xz
(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.
Diffstat (limited to 'src/yapf')
-rw-r--r--src/yapf/yapf_base.hpp4
-rw-r--r--src/yapf/yapf_rail.cpp6
-rw-r--r--src/yapf/yapf_road.cpp6
-rw-r--r--src/yapf/yapf_ship.cpp4
4 files changed, 10 insertions, 10 deletions
diff --git a/src/yapf/yapf_base.hpp b/src/yapf/yapf_base.hpp
index 7ccd4ebf5..d31e2fb9e 100644
--- a/src/yapf/yapf_base.hpp
+++ b/src/yapf/yapf_base.hpp
@@ -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)
diff --git a/src/yapf/yapf_rail.cpp b/src/yapf/yapf_rail.cpp
index 2651a9df4..d5d95f435 100644
--- a/src/yapf/yapf_rail.cpp
+++ b/src/yapf/yapf_rail.cpp
@@ -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
}
diff --git a/src/yapf/yapf_road.cpp b/src/yapf/yapf_road.cpp
index 6234a7e63..a925ba280 100644
--- a/src/yapf/yapf_road.cpp
+++ b/src/yapf/yapf_road.cpp
@@ -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);
diff --git a/src/yapf/yapf_ship.cpp b/src/yapf/yapf_ship.cpp
index bd433d84d..11a4f1e57 100644
--- a/src/yapf/yapf_ship.cpp
+++ b/src/yapf/yapf_ship.cpp
@@ -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);