1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 17:39:09 +00:00

(svn r6159) -Fix: FindClosestTrainDepot hardly ever found a depot with NPF off due to absence of distance-normalization (Rojer)

This commit is contained in:
Darkvater
2006-08-26 21:54:04 +00:00
parent 6540ae18fd
commit 45fa300208
3 changed files with 7 additions and 6 deletions

View File

@@ -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;
}