summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-08-06 13:44:50 +0000
committermaedhros <maedhros@openttd.org>2007-08-06 13:44:50 +0000
commite0e361c89044ad5fff5bab6ec289fd13eeb28b2e (patch)
treee4a10f247203b204dcbbbe5b62a20c2fa1995918
parent8c4a4baac1d452dd572a756ba1cef7aaac587c9f (diff)
downloadopenttd-e0e361c89044ad5fff5bab6ec289fd13eeb28b2e.tar.xz
(svn r10812) -Fix (r10097) [FS#1093]: Make RoadVehicle::MarkDirty() mark all parts of articulated vehicles as dirty, not just the front.
-rw-r--r--src/roadveh_cmd.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index a8420fc80..c1e98d69c 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -556,8 +556,10 @@ CommandCost CmdTurnRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
void RoadVehicle::MarkDirty()
{
- this->cur_image = this->GetImage(this->direction);
- MarkAllViewportsDirty(this->left_coord, this->top_coord, this->right_coord + 1, this->bottom_coord + 1);
+ for (Vehicle *v = this; v != NULL; v = v->next) {
+ v->cur_image = v->GetImage(v->direction);
+ MarkAllViewportsDirty(v->left_coord, v->top_coord, v->right_coord + 1, v->bottom_coord + 1);
+ }
}
void RoadVehicle::UpdateDeltaXY(Direction direction)