* Switches viewports following vehicles, which get autoreplaced * @param from_index the old vehicle ID * @param to_index the new vehicle ID */
| 3511 | * @param to_index the new vehicle ID |
| 3512 | */ |
| 3513 | void ChangeVehicleViewports(VehicleID from_index, VehicleID to_index) |
| 3514 | { |
| 3515 | for (const Window *w : Window::Iterate()) { |
| 3516 | if (w->viewport != nullptr && w->viewport->follow_vehicle == from_index) { |
| 3517 | w->viewport->follow_vehicle = to_index; |
| 3518 | w->SetDirty(); |
| 3519 | } |
| 3520 | } |
| 3521 | } |
| 3522 | |
| 3523 | |
| 3524 | /** |
no test coverage detected