summaryrefslogtreecommitdiff
path: root/src/bridge_gui.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2008-02-05 05:21:02 +0000
committerbelugas <belugas@openttd.org>2008-02-05 05:21:02 +0000
commit62b3520e51fb51c66c094f304a85461564c0b364 (patch)
tree9c2717a65edae3fd296acdab60dde15fb2ba163c /src/bridge_gui.cpp
parent80daad8d4df808d3500c0b677b1282fcdc122dfc (diff)
downloadopenttd-62b3520e51fb51c66c094f304a85461564c0b364.tar.xz
(svn r12066) -Codechange: Rename GetBridge for the more common GetBridgeSpec
-Codechange: Remove direct access to the _bridge table in favor of the above mentioned GetBridgeSpec -Codechange: Rationalize the use of Bridge type pointer
Diffstat (limited to 'src/bridge_gui.cpp')
-rw-r--r--src/bridge_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp
index 5b74e0cde..11d8ee074 100644
--- a/src/bridge_gui.cpp
+++ b/src/bridge_gui.cpp
@@ -79,7 +79,7 @@ static void BuildBridgeWndProc(Window *w, WindowEvent *e)
uint y = 15;
for (uint i = 0; (i < w->vscroll.cap) && ((i + w->vscroll.pos) < _bridgedata.count); i++) {
- const Bridge *b = &_bridge[_bridgedata.indexes[i + w->vscroll.pos]];
+ const Bridge *b = GetBridgeSpec(_bridgedata.indexes[i + w->vscroll.pos]);
SetDParam(2, _bridgedata.costs[i + w->vscroll.pos]);
SetDParam(1, b->speed * 10 / 16);
@@ -191,7 +191,7 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, byte bridge_type)
for (bridge_type = 0; bridge_type != MAX_BRIDGES; bridge_type++) {
if (CheckBridge_Stuff(bridge_type, bridge_len)) {
/* bridge is accepted, add to list */
- const Bridge *b = &_bridge[bridge_type];
+ const Bridge *b = GetBridgeSpec(bridge_type);
/* Add to terraforming & bulldozing costs the cost of the
* bridge itself (not computed with DC_QUERY_COST) */
_bridgedata.costs[j] = ret.GetCost() + (((int64)tot_bridgedata_len * _price.build_bridge * b->price) >> 8);