summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index eecf6741f..fa68a9247 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -1248,7 +1248,6 @@ static bool RoadVehLeaveDepot(Vehicle *v, bool first)
v->u.road.state = tdir;
v->u.road.frame = RVC_DEPOT_START_FRAME;
- v->cur_image = v->GetImage(v->direction);
v->UpdateDeltaXY(v->direction);
SetRoadVehPosition(v, x, y);
@@ -1377,7 +1376,6 @@ static bool IndividualRoadVehicleController(Vehicle *v, const Vehicle *prev)
if (IsTileType(gp.new_tile, MP_TUNNELBRIDGE) && HasBit(VehicleEnterTile(v, gp.new_tile, gp.x, gp.y), VETS_ENTERED_WORMHOLE)) {
/* Vehicle has just entered a bridge or tunnel */
- v->cur_image = v->GetImage(v->direction);
v->UpdateDeltaXY(v->direction);
SetRoadVehPosition(v, gp.x, gp.y);
return true;
@@ -1524,7 +1522,6 @@ again:
v->cur_speed -= v->cur_speed >> 2;
}
- v->cur_image = v->GetImage(v->direction);
v->UpdateDeltaXY(v->direction);
RoadZPosAffectSpeed(v, SetRoadVehPosition(v, x, y));
return true;
@@ -1590,7 +1587,6 @@ again:
v->cur_speed -= v->cur_speed >> 2;
}
- v->cur_image = v->GetImage(v->direction);
v->UpdateDeltaXY(v->direction);
RoadZPosAffectSpeed(v, SetRoadVehPosition(v, x, y));
return true;
@@ -1631,7 +1627,6 @@ again:
v->cur_speed -= (v->cur_speed >> 2);
if (old_dir != v->u.road.state) {
/* The vehicle is in a road stop */
- v->cur_image = v->GetImage(v->direction);
v->UpdateDeltaXY(v->direction);
SetRoadVehPosition(v, v->x_pos, v->y_pos);
/* Note, return here means that the frame counter is not incremented
@@ -1755,7 +1750,6 @@ again:
* in a depot or entered a tunnel/bridge */
if (!HasBit(r, VETS_ENTERED_WORMHOLE)) v->u.road.frame++;
- v->cur_image = v->GetImage(v->direction);
v->UpdateDeltaXY(v->direction);
RoadZPosAffectSpeed(v, SetRoadVehPosition(v, x, y));
return true;
@@ -1813,6 +1807,14 @@ static void RoadVehController(Vehicle *v)
if (j >= adv_spd && RoadVehCheckTrainCrash(v)) break;
}
+ for (Vehicle *u = v; u != NULL; u = u->Next()) {
+ if ((u->vehstatus & VS_HIDDEN) != 0) continue;
+
+ uint16 old_image = u->cur_image;
+ u->cur_image = u->GetImage(u->direction);
+ if (old_image != u->cur_image) VehicleMove(u, true);
+ }
+
if (v->progress == 0) v->progress = j;
}