src/aircraft_cmd.cpp
changeset 10177 41ce7529a331
parent 10154 5ae6e5fe6c71
child 10207 c291a21b304e
equal deleted inserted replaced
10176:bd20cc54b41f 10177:41ce7529a331
   971  */
   971  */
   972 static bool AircraftController(Vehicle *v)
   972 static bool AircraftController(Vehicle *v)
   973 {
   973 {
   974 	int count;
   974 	int count;
   975 
   975 
   976 	StationID target = v->u.air.targetairport;
       
   977 
       
   978 	/* NULL if station is invalid */
   976 	/* NULL if station is invalid */
   979 	const Station *st = IsValidStationID(target) ? GetStation(target) : NULL;
   977 	const Station *st = IsValidStationID(v->u.air.targetairport) ? GetStation(v->u.air.targetairport) : NULL;
   980 	/* 0 if there is no station */
   978 	/* 0 if there is no station */
   981 	TileIndex tile = 0;
   979 	TileIndex tile = 0;
   982 	if (st != NULL) {
   980 	if (st != NULL) {
   983 		tile = st->airport_tile;
   981 		tile = st->airport_tile;
   984 		if (tile == 0) tile = st->xy;
   982 		if (tile == 0) tile = st->xy;