From feec9cc7cf93f40be21f65416b6bbadc58d1b99e Mon Sep 17 00:00:00 2001 From: Darkvater Date: Mon, 30 May 2005 13:35:39 +0000 Subject: [PATCH] (svn r2382) - Fix: Check the airport type when building an airport --- station_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/station_cmd.c b/station_cmd.c index 1e99d3eb1f..2d914fbf3b 100644 --- a/station_cmd.c +++ b/station_cmd.c @@ -1672,7 +1672,7 @@ int32 CmdBuildAirport(int x, int y, uint32 flags, uint32 p1, uint32 p2) SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION); /* Check if a valid, buildable airport was chosen for construction */ - if (!HASBIT(GetValidAirports(), p1)) return CMD_ERROR; + if (p1 > lengthof(_airport_map5_tiles) || !HASBIT(GetValidAirports(), p1)) return CMD_ERROR; tile = TILE_FROM_XY(x,y);