(svn r23147) -Change: [NewGRF v8] Unify the return values of boolean callbacks, and check the results for validity.

This commit is contained in:
frosch
2011-11-08 17:26:49 +00:00
parent b98c7763de
commit 30874b5e81
11 changed files with 90 additions and 28 deletions

View File

@@ -287,7 +287,7 @@ bool DrawNewAirportTile(TileInfo *ti, Station *st, StationGfx gfx, const Airport
if (HasBit(airts->callback_mask, CBM_AIRT_DRAW_FOUNDATIONS)) {
/* Called to determine the type (if any) of foundation to draw */
uint32 callback_res = GetAirportTileCallback(CBID_AIRPTILE_DRAW_FOUNDATIONS, 0, 0, airts, st, ti->tile);
draw_old_one = (callback_res != 0);
if (callback_res != CALLBACK_FAILED) draw_old_one = ConvertBooleanCallback(airts->grf_prop.grffile, CBID_AIRPTILE_DRAW_FOUNDATIONS, callback_res);
}
if (draw_old_one) DrawFoundation(ti, FOUNDATION_LEVELED);