summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2007-12-15 16:11:29 +0000
committersmatz <smatz@openttd.org>2007-12-15 16:11:29 +0000
commitc972d309bef752f19bcbdd7117912a96c1879c85 (patch)
tree685beba35ce7c5f5358fdebf9a7caabb8163e8f8
parent76391f449805359167ca1a0dcfbb281ddeb1f13f (diff)
downloadopenttd-c972d309bef752f19bcbdd7117912a96c1879c85.tar.xz
(svn r11637) -Fix: mark viewports dirty when removing visible vehicle chain
-rw-r--r--src/vehicle.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 693b2e269..63ffc0927 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -606,6 +606,11 @@ void DeleteVehicleChain(Vehicle *v)
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);