MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ValidateChainIndex

Method ValidateChainIndex

src/newgrf_debug_gui.cpp:321–330  ·  view source on GitHub ↗

* Ensure that this->chain_index is in range. */

Source from the content-addressed store, hash-verified

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 {

Callers 1

OnInvalidateDataMethod · 0.95

Calls 3

HasChainIndexMethod · 0.95
GetFeatureIndexFunction · 0.85
MoveMethod · 0.80

Tested by

no test coverage detected