# HG changeset patch # User richk # Date 1186627542 0 # Node ID 058a44ffc7c2647af12b8eb061de35b91f988b04 # Parent 1561fc957d15afe263dc4ff121b1f1db2340ee15 (svn r10830) [NewGRF_ports] -Fix: Only test and draw a preview picture if the fsmportspec can be accessed. diff -r 1561fc957d15 -r 058a44ffc7c2 src/airport_gui.cpp --- a/src/airport_gui.cpp Thu Aug 09 02:43:04 2007 +0000 +++ b/src/airport_gui.cpp Thu Aug 09 02:45:42 2007 +0000 @@ -221,14 +221,13 @@ SetDParam(0, GetFSMportsClassName(_airport.fsmports_class)); DrawWindowWidgets(w); - /* only draw the preview image if the station is available */ - if (!HASBIT(fsmportspec->callbackmask, CBM_STATION_AVAIL) || GetFSMportsCallback(CBID_STATION_AVAILABILITY, 0, 0, fsmportspec, NULL, INVALID_TILE) != 0) { - DrawFSMportsTile(9, 106, preview_sprite, _airport.fsmports_class, _airport.station_type); - } - // strings such as 'Size' and 'Coverage Area' // 'Coverage Area' if (_airport.station_type != 0xFF) { + /* only draw the preview image if the station is available */ + if (!HASBIT(fsmportspec->callbackmask, CBM_STATION_AVAIL) || GetFSMportsCallback(CBID_STATION_AVAILABILITY, 0, 0, fsmportspec, NULL, INVALID_TILE) != 0) { + DrawFSMportsTile(9, 106, preview_sprite, _airport.fsmports_class, _airport.station_type); + } int rad = _patches.modified_catchment ? fsmportspec->portFSM->catchment : 4; if (_station_show_coverage) SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad); DrawStationCoverageAreaText(2, 206, SCT_ALL, rad);