diff options
author | frosch <frosch@openttd.org> | 2011-11-08 17:27:13 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-11-08 17:27:13 +0000 |
commit | 52774235eb6eb8affb7e68b94c490d3f09e7ae31 (patch) | |
tree | af07d5b6df28b5c9fdcef94e0f67ecec290e1764 /src/station_cmd.cpp | |
parent | 30874b5e81af0fff2f42d34b9b105ee86666b8ac (diff) | |
download | openttd-52774235eb6eb8affb7e68b94c490d3f09e7ae31.tar.xz |
(svn r23148) -Change: [NewGRF] Check the results of various callbacks for validness.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index a1fb6e2c4..96251a8fe 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1252,7 +1252,13 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32 /* As the station is not yet completely finished, the station does not yet exist. */ uint16 callback = GetStationCallback(CBID_STATION_TILE_LAYOUT, platinfo, 0, statspec, NULL, tile); - if (callback != CALLBACK_FAILED && callback < 8) SetStationGfx(tile, (callback & ~1) + axis); + if (callback != CALLBACK_FAILED) { + if (callback < 8) { + SetStationGfx(tile, (callback & ~1) + axis); + } else { + ErrorUnknownCallbackResult(statspec->grf_prop.grffile->grfid, CBID_STATION_TILE_LAYOUT, callback); + } + } /* Trigger station animation -- after building? */ TriggerStationAnimation(st, tile, SAT_BUILT); |