File diff r6911:ed6c7a27b50b → r6912:8b1a63da4658
src/newgrf_engine.cpp
Show inline comments
 
@@ -236,24 +236,26 @@ enum {
 
	AMS_TTDP_HELI_TO_TAKEOFF_HELIPORT,
 
	AMS_TTDP_HELI_LAND_HELIPORT,
 
};
 

	
 

	
 
/**
 
 * Map OTTD aircraft movement states to TTDPatch style movement states
 
 * (VarAction 2 Variable 0xE2)
 
 */
 
static byte MapAircraftMovementState(const Vehicle *v)
 
{
 
	const Station *st = GetStation(v->u.air.targetairport);
 
	if (st->airport_tile == 0) return AMS_TTDP_FLIGHT_TO_TOWER;
 

	
 
	const AirportFTAClass *afc = st->Airport();
 
	uint16 amdflag = afc->MovingData(v->u.air.pos)->flag;
 

	
 
	switch (v->u.air.state) {
 
		case HANGAR:
 
			/* The international airport is a special case as helicopters can land in
 
			 * front of the hanger. Helicopters also change their air.state to
 
			 * AMED_HELI_LOWER some time before actually descending. */
 

	
 
			/* This condition only occurs for helicopters, during descent,
 
			 * to a landing by the hanger of an international airport. */
 
			if (amdflag & AMED_HELI_LOWER) return AMS_TTDP_HELI_LAND_AIRPORT;