diff options
author | celestar <celestar@openttd.org> | 2007-02-02 16:51:10 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2007-02-02 16:51:10 +0000 |
commit | 22dc618582fcb00bedab2e02c35e2f9f9ff680ed (patch) | |
tree | b452bc1cfa211c8321cb8bfaf097f53557a3fafc /src/roadveh_cmd.cpp | |
parent | 1c013055b6b409281e5bd4463a54e5a9ee6482cd (diff) | |
download | openttd-22dc618582fcb00bedab2e02c35e2f9f9ff680ed.tar.xz |
(svn r8536) -Fix (FS#577): Road Vehicles now can obtain a slot even if the station is very spread out
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r-- | src/roadveh_cmd.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index bed8f0a00..dc37bdf92 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -1663,7 +1663,13 @@ void OnNewDay_RoadVeh(Vehicle *v) RoadStop* best = NULL; if (rs != NULL) { - if (DistanceManhattan(v->tile, st->xy) < 16) { + /* We try to obtain a slot if: + * 1) we're reasonably close to the primary road stop + * or + * 2) we're somewhere close to the station rectangle (to make sure we do assign + * slots even if the station and its road stops are incredibly spread out) + */ + if (DistanceManhattan(v->tile, rs->xy) < 16 || st->rect.PtInExtendedRect(TileX(v->tile), TileY(v->tile), 2)) { uint dist, badness; uint minbadness = UINT_MAX; |