forked from mirror/OpenTTD
(svn r23147) -Change: [NewGRF v8] Unify the return values of boolean callbacks, and check the results for validity.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user