summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2006-08-26 21:54:04 +0000
committerDarkvater <Darkvater@openttd.org>2006-08-26 21:54:04 +0000
commit4f00dd74000ad9828d006d421e2de3a4f76a6090 (patch)
treeec8cd508fd46492ed27f78bc9edf6ea11d659dd3 /train_cmd.c
parentea0fbc1118e7455241827c330bb845c768db3655 (diff)
downloadopenttd-4f00dd74000ad9828d006d421e2de3a4f76a6090.tar.xz
(svn r6159) -Fix: FindClosestTrainDepot hardly ever found a depot with NPF off due to absence of distance-normalization (Rojer)
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 5fe309c98..468bcdba6 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -1847,7 +1847,8 @@ static bool NtpCallbFindDepot(TileIndex tile, TrainFindDepotData *tfdd, int trac
if (IsTileType(tile, MP_RAILWAY) &&
IsTileOwner(tile, tfdd->owner) &&
IsRailDepot(tile)) {
- tfdd->best_length = length;
+ /* approximate number of tiles by dividing by DIAG_FACTOR */
+ tfdd->best_length = length / DIAG_FACTOR;
tfdd->tile = tile;
return true;
}