station_cmd.c
changeset 1876 95c95857ec7b
parent 1840 c181d5cb4ffe
child 1881 023a134a4b12
--- a/station_cmd.c	Mon May 30 13:06:15 2005 +0000
+++ b/station_cmd.c	Mon May 30 13:35:39 2005 +0000
@@ -1672,7 +1672,7 @@
 	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);