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

Function FindClosestTrainDepot

src/train_cmd.cpp:2199–2204  ·  view source on GitHub ↗

* Try to find a depot nearby. * @param v %Train that wants a depot. * @param max_distance Maximal search distance. * @return Information where the closest train depot is located. * @pre The given vehicle must not be crashed! */

Source from the content-addressed store, hash-verified

2197 * @pre The given vehicle must not be crashed!
2198 */
2199static FindDepotData FindClosestTrainDepot(Train *v, int max_distance)
2200{
2201 assert(!v->vehstatus.Test(VehState::Crashed));
2202
2203 return YapfTrainFindNearestDepot(v, max_distance);
2204}
2205
2206ClosestDepot Train::FindClosestDepot()
2207{

Callers 2

FindClosestDepotMethod · 0.85
CheckIfTrainNeedsServiceFunction · 0.85

Calls 2

TestMethod · 0.80

Tested by

no test coverage detected