src/aircraft_cmd.cpp
changeset 7683 13e6fb7baa57
parent 7642 535e5d93ffb1
child 7695 4b27fd86b318
equal deleted inserted replaced
7682:ee53a5efa35b 7683:13e6fb7baa57
   280 	if (!IsHangarTile(tile) || !IsTileOwner(tile, _current_player)) return CMD_ERROR;
   280 	if (!IsHangarTile(tile) || !IsTileOwner(tile, _current_player)) return CMD_ERROR;
   281 
   281 
   282 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
   282 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
   283 
   283 
   284 	/* Prevent building aircraft types at places which can't handle them */
   284 	/* Prevent building aircraft types at places which can't handle them */
   285 	if (!IsAircraftBuildableAtStation(p1, tile)) return CMD_ERROR;
   285 	if (!CanAircraftUseStation(p1, tile)) return CMD_ERROR;
   286 
   286 
   287 	/* Allocate 2 or 3 vehicle structs, depending on type
   287 	/* Allocate 2 or 3 vehicle structs, depending on type
   288 	 * vl[0] = aircraft, vl[1] = shadow, [vl[2] = rotor] */
   288 	 * vl[0] = aircraft, vl[1] = shadow, [vl[2] = rotor] */
   289 	Vehicle *vl[3];
   289 	Vehicle *vl[3];
   290 	if (!Vehicle::AllocateList(vl, avi->subtype & AIR_CTOL ? 2 : 3)) {
   290 	if (!Vehicle::AllocateList(vl, avi->subtype & AIR_CTOL ? 2 : 3)) {