forked from mirror/OpenTTD
Codechange: Check airport layout would fit within map bounds before iterating tiles. (#7429)
This commit is contained in:
@@ -2268,6 +2268,7 @@ CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
|
||||
/* Check if a valid, buildable airport was chosen for construction */
|
||||
const AirportSpec *as = AirportSpec::Get(airport_type);
|
||||
if (!as->IsAvailable() || layout >= as->num_table) return CMD_ERROR;
|
||||
if (!as->IsWithinMapBounds(layout, tile)) return CMD_ERROR;
|
||||
|
||||
Direction rotation = as->rotation[layout];
|
||||
int w = as->size_x;
|
||||
|
Reference in New Issue
Block a user