* Check whether a road stop type can be built. * @return true if building is allowed. */
| 100 | * @return true if building is allowed. |
| 101 | */ |
| 102 | static bool IsRoadStopAvailable(const RoadStopSpec *spec, StationType type) |
| 103 | { |
| 104 | if (spec == nullptr) return true; |
| 105 | if (!IsRoadStopEverAvailable(spec, type)) return false; |
| 106 | |
| 107 | if (!spec->callback_mask.Test(RoadStopCallbackMask::Avail)) return true; |
| 108 | |
| 109 | uint16_t cb_res = GetRoadStopCallback(CBID_STATION_AVAILABILITY, 0, 0, spec, nullptr, INVALID_TILE, _cur_roadtype, type, 0); |
| 110 | if (cb_res == CALLBACK_FAILED) return true; |
| 111 | |
| 112 | return Convert8bitBooleanCallback(spec->grf_prop.grffile, CBID_STATION_AVAILABILITY, cb_res); |
| 113 | } |
| 114 | |
| 115 | void CcPlaySound_CONSTRUCTION_OTHER(Commands, const CommandCost &result, TileIndex tile) |
| 116 | { |
no test coverage detected