Merge branch 'master' into jgrpp

# Conflicts:
#	bin/baseset/no_sound.obs
#	bin/baseset/orig_dos.obg
#	bin/baseset/orig_dos.obs
#	bin/baseset/orig_dos_de.obg
#	bin/baseset/orig_win.obg
#	bin/baseset/orig_win.obm
#	bin/baseset/orig_win.obs
#	src/aircraft_cmd.cpp
#	src/blitter/32bpp_anim.cpp
#	src/blitter/32bpp_anim.hpp
#	src/blitter/32bpp_base.cpp
#	src/blitter/32bpp_base.hpp
#	src/blitter/8bpp_base.cpp
#	src/blitter/8bpp_base.hpp
#	src/blitter/common.hpp
#	src/group_gui.cpp
#	src/lang/korean.txt
#	src/linkgraph/linkgraph_gui.cpp
#	src/saveload/saveload.cpp
#	src/town_cmd.cpp
#	src/viewport.cpp
#	src/viewport_func.h
This commit is contained in:
Jonathan G Rennison
2019-01-29 02:28:14 +00:00
101 changed files with 8211 additions and 1612 deletions

View File

@@ -129,21 +129,15 @@ static StationID FindNearestHangar(const Aircraft *v)
const AircraftVehicleInfo *avi = AircraftVehInfo(v->engine_type);
FOR_ALL_STATIONS(st) {
if (!IsInfraUsageAllowed(VEH_AIRCRAFT, v->owner, st->owner) || !(st->facilities & FACIL_AIRPORT)) continue;
if (!IsInfraUsageAllowed(VEH_AIRCRAFT, v->owner, st->owner) || !(st->facilities & FACIL_AIRPORT) || !st->airport.HasHangar()) continue;
const AirportFTAClass *afc = st->airport.GetFTA();
if (!st->airport.HasHangar() || (
/* the airport needs to have facilities for this plane type */
(AircraftVehInfo(v->engine_type)->subtype & AIR_CTOL) ?
!(afc->flags & AirportFTAClass::AIRPLANES) :
!(afc->flags & AirportFTAClass::HELICOPTERS)
) || (
/* don't crash the plane if we know it can't land at the airport */
(afc->flags & AirportFTAClass::SHORT_STRIP) &&
(avi->subtype & AIR_FAST) &&
!_cheats.no_jetcrash.value)) {
continue;
}
/* don't crash the plane if we know it can't land at the airport */
if ((afc->flags & AirportFTAClass::SHORT_STRIP) && (avi->subtype & AIR_FAST) && !_cheats.no_jetcrash.value) continue;
/* the plane won't land at any helicopter station */
if (!(afc->flags & AirportFTAClass::AIRPLANES) && (avi->subtype & AIR_CTOL)) continue;
/* v->tile can't be used here, when aircraft is flying v->tile is set to 0 */
uint distance = DistanceSquare(vtile, st->airport.tile);
@@ -392,7 +386,7 @@ bool Aircraft::FindClosestDepot(TileIndex *location, DestinationID *destination,
{
const Station *st = GetTargetAirportIfValid(this);
/* If the station is not a valid airport or if it has no hangars */
if (st == NULL || !st->airport.HasHangar()) {
if (st == NULL || !CanVehicleUseStation(this, st) || !st->airport.HasHangar()) {
/* the aircraft has to search for a hangar on its own */
StationID station = FindNearestHangar(this);
@@ -1624,7 +1618,7 @@ static void AircraftEventHandler_AtTerminal(Aircraft *v, const AirportFTAClass *
go_to_hangar = Station::Get(v->targetairport)->airport.HasHangar();
}
if (go_to_hangar) {
if (go_to_hangar && Station::Get(v->targetairport)->airport.HasHangar()) {
v->state = HANGAR;
} else {
/* airplane goto state takeoff, helicopter to helitakeoff */