changeset 8076:acfeedbb9362 draft

(svn r11637) -Fix: mark viewports dirty when removing visible vehicle chain
author smatz <smatz@openttd.org>
date Sat, 15 Dec 2007 16:11:29 +0000
parents 8de1216a9e47
children ca41f364c9f6
files src/vehicle.cpp
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -606,6 +606,11 @@
 
 	do {
 		Vehicle *u = v;
+		if (!(v->vehstatus & VS_HIDDEN)) {
+			/* sometimes, eg. for disaster vehicles, when company bankrupts, when removing crashed/flooded vehicles,
+			 * it may happen that vehicle chain is deleted when visible */
+			MarkAllViewportsDirty(v->left_coord, v->top_coord, v->right_coord + 1, v->bottom_coord + 1);
+		}
 		v = v->Next();
 		delete u;
 	} while (v != NULL);