summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-10-25 13:51:47 +0000
committerrubidium <rubidium@openttd.org>2008-10-25 13:51:47 +0000
commita14ad77a36c836fd3f6940eadeb8161e7ad02f92 (patch)
treeba7c12966aad60d82c8e03bb0593bce949ec2b86 /src/station_cmd.cpp
parent9075a2bbfc7c33a089fe100c42b96b831521d6d8 (diff)
downloadopenttd-a14ad77a36c836fd3f6940eadeb8161e7ad02f92.tar.xz
(svn r14528) -Codechange: cache the closest town for all road tiles instead of only roads owned by tiles. This replaces a O(n) search over all towns from the road's tileloop with a O(1) lookup (PhilSophus)
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 5bd1feb21..ecddffc75 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1590,7 +1590,7 @@ CommandCost CmdRemoveRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2
/* Rebuild the drive throuhg road stop. As a road stop can only be
* removed by the owner of the roadstop, _current_company is the
* owner of the road stop. */
- MakeRoadNormal(tile, road_bits, rts, is_towns_road ? ClosestTownFromTile(tile, UINT_MAX)->index : 0,
+ MakeRoadNormal(tile, road_bits, rts, ClosestTownFromTile(tile, UINT_MAX)->index,
is_towns_road ? OWNER_TOWN : _current_company, _current_company, _current_company);
}