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

Function IsStationAvailable

src/rail_gui.cpp:87–95  ·  view source on GitHub ↗

* Check whether a station type can be build. * @return true if building is allowed. */

Source from the content-addressed store, hash-verified

85 * @return true if building is allowed.
86 */
87static bool IsStationAvailable(const StationSpec *statspec)
88{
89 if (statspec == nullptr || !statspec->callback_mask.Test(StationCallbackMask::Avail)) return true;
90
91 uint16_t cb_res = GetStationCallback(CBID_STATION_AVAILABILITY, 0, 0, statspec, nullptr, INVALID_TILE);
92 if (cb_res == CALLBACK_FAILED) return true;
93
94 return Convert8bitBooleanCallback(statspec->grf_prop.grffile, CBID_STATION_AVAILABILITY, cb_res);
95}
96
97void CcPlaySound_CONSTRUCTION_RAIL(Commands, const CommandCost &result, TileIndex tile)
98{

Callers 2

IsTypeAvailableMethod · 0.85
IsTypeAvailableMethod · 0.85

Calls 3

GetStationCallbackFunction · 0.85
TestMethod · 0.80

Tested by

no test coverage detected