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

Method FindClosestDepot

src/train_cmd.cpp:2206–2212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2204}
2205
2206ClosestDepot Train::FindClosestDepot()
2207{
2208 FindDepotData tfdd = FindClosestTrainDepot(this, 0);
2209 if (tfdd.best_length == UINT_MAX) return ClosestDepot();
2210
2211 return ClosestDepot(tfdd.tile, GetDepotIndex(tfdd.tile), tfdd.reverse);
2212}
2213
2214/** Play a sound for a train leaving the station. */
2215void Train::PlayLeaveStationSound(bool force) const

Callers

nothing calls this directly

Calls 3

FindClosestTrainDepotFunction · 0.85
ClosestDepotClass · 0.85
GetDepotIndexFunction · 0.85

Tested by

no test coverage detected