summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-11-19 18:58:32 +0000
committerrubidium <rubidium@openttd.org>2007-11-19 18:58:32 +0000
commita4df4728fc057d507e66169d7c1f2244ed571078 (patch)
treeff6f01b3a50f819e7e0182d0e4ea36187fa0f964 /src
parent50bfe1a19d26d99b6ee10236771bd8c7cd38be01 (diff)
downloadopenttd-a4df4728fc057d507e66169d7c1f2244ed571078.tar.xz
(svn r11477) -Fix [FS#1451]: a road vehicle must not show that it is driving max speed when it is standing still waiting for the vehicle in from of it.
Diffstat (limited to 'src')
-rw-r--r--src/roadveh_cmd.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index ce3ae239a..def45112a 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -1624,7 +1624,13 @@ again:
y = TileY(tile) * TILE_SIZE + rdp[start_frame].y;
newdir = RoadVehGetSlidingDirection(v, x, y);
- if (IsRoadVehFront(v) && RoadVehFindCloseTo(v, x, y, newdir) != NULL) return false;
+ if (IsRoadVehFront(v)) {
+ Vehicle *u = RoadVehFindCloseTo(v, x, y, newdir);
+ if (u != NULL) {
+ v->cur_speed = u->First()->cur_speed;
+ return false;
+ }
+ }
r = VehicleEnterTile(v, tile, x, y);
if (HASBIT(r, VETS_CANNOT_ENTER)) {