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

Method GetByTile

src/roadstop.cpp:253–261  ·  view source on GitHub ↗

* Find a roadstop at given tile * @param tile tile with roadstop * @param type roadstop type * @return pointer to RoadStop * @pre there has to be roadstop of given type there! */ static */

Source from the content-addressed store, hash-verified

251 * @pre there has to be roadstop of given type there!
252 */
253/* static */ RoadStop *RoadStop::GetByTile(TileIndex tile, RoadStopType type)
254{
255 const Station *st = Station::GetByTile(tile);
256
257 for (RoadStop *rs = st->GetPrimaryRoadStop(type);; rs = rs->next) {
258 if (rs->xy == tile) return rs;
259 assert(rs->next != nullptr);
260 }
261}
262
263/**
264 * Leave the road stop

Callers

nothing calls this directly

Calls 1

GetPrimaryRoadStopMethod · 0.45

Tested by

no test coverage detected