diff options
-rw-r--r-- | src/vehicle.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index c6abc3f25..4851a4529 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1416,12 +1416,16 @@ void VehicleUpdateViewport(Vehicle *v, bool dirty) v->coord.bottom = pt.y + spr->height + 2 * ZOOM_LVL_BASE; if (dirty) { - MarkAllViewportsDirty( - min(old_coord.left, v->coord.left), - min(old_coord.top, v->coord.top), - max(old_coord.right, v->coord.right) + 1 * ZOOM_LVL_BASE, - max(old_coord.bottom, v->coord.bottom) + 1 * ZOOM_LVL_BASE - ); + if (old_coord.left == INVALID_COORD) { + MarkSingleVehicleDirty(v); + } else { + MarkAllViewportsDirty( + min(old_coord.left, v->coord.left), + min(old_coord.top, v->coord.top), + max(old_coord.right, v->coord.right) + 1 * ZOOM_LVL_BASE, + max(old_coord.bottom, v->coord.bottom) + 1 * ZOOM_LVL_BASE + ); + } } } |