summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-11-08 17:26:49 +0000
committerfrosch <frosch@openttd.org>2011-11-08 17:26:49 +0000
commit30874b5e81af0fff2f42d34b9b105ee86666b8ac (patch)
tree6fd8200f08019910de826cf6f1b9b6e92f7d2d69 /src/station_cmd.cpp
parentb98c7763de42eda4b3d19604bc3f33452b9b05e4 (diff)
downloadopenttd-30874b5e81af0fff2f42d34b9b105ee86666b8ac.tar.xz
(svn r23147) -Change: [NewGRF v8] Unify the return values of boolean callbacks, and check the results for validity.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp5
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;
}
}