diff options
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 00152246c..a1fb6e2c4 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1187,8 +1187,9 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32 } /* Check if the station is buildable */ - if (HasBit(statspec->callback_mask, CBM_STATION_AVAIL) && GB(GetStationCallback(CBID_STATION_AVAILABILITY, 0, 0, statspec, NULL, INVALID_TILE), 0, 8) == 0) { - return CMD_ERROR; + if (HasBit(statspec->callback_mask, CBM_STATION_AVAIL)) { + uint16 cb_res = GetStationCallback(CBID_STATION_AVAILABILITY, 0, 0, statspec, NULL, INVALID_TILE); + if (cb_res != CALLBACK_FAILED && !Convert8bitBooleanCallback(statspec->grf_prop.grffile, CBID_STATION_AVAILABILITY, cb_res)) return CMD_ERROR; } } |