(svn r10812) -Fix (r10097) [FS#1093]: Make RoadVehicle::MarkDirty() mark all parts of articulated vehicles as dirty, not just the front.
authormaedhros
Mon, 06 Aug 2007 13:44:50 +0000
changeset 7419 531c4851ba85
parent 7418 ef667c8ccda0
child 7420 0e3afa8102f0
(svn r10812) -Fix (r10097) [FS#1093]: Make RoadVehicle::MarkDirty() mark all parts of articulated vehicles as dirty, not just the front.
src/roadveh_cmd.cpp
--- a/src/roadveh_cmd.cpp	Mon Aug 06 13:05:45 2007 +0000
+++ b/src/roadveh_cmd.cpp	Mon Aug 06 13:44:50 2007 +0000
@@ -556,8 +556,10 @@
 
 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)