* Ensure that this->chain_index is in range. */
| 319 | * Ensure that this->chain_index is in range. |
| 320 | */ |
| 321 | void ValidateChainIndex() |
| 322 | { |
| 323 | if (this->chain_index == 0) return; |
| 324 | |
| 325 | assert(this->HasChainIndex()); |
| 326 | |
| 327 | const Vehicle *v = Vehicle::Get(::GetFeatureIndex(this->window_number)); |
| 328 | v = v->Move(this->chain_index); |
| 329 | if (v == nullptr) this->chain_index = 0; |
| 330 | } |
| 331 | |
| 332 | NewGRFInspectWindow(WindowDesc &desc, WindowNumber wno) : Window(desc) |
| 333 | { |
no test coverage detected