Apache speed fix (#3315)

This PR 1) introduces a cruise_speed parameter to the AircraftType class
and uses it as an override for default TOT/Ground Speed calculations and
2) sets this for the AH64.

The reason for this change is that air starts with the Apache at a speed
>130kt seems to completely break the FCR, even if you subsequently slow
down. In the development branch, Liberation sets the Apache to travel at
168kt, so any player air starting won't be able to use their FCR and it
wouldn't be readily apparent as to why.

In the longer run this parameter may also be useful for other aircraft
e.g. to override the cruise speed to the most efficient etc.
This commit is contained in:
zhexu14 2023-12-28 09:04:16 +11:00 committed by GitHub
parent 03caddc1b4
commit 211ec86e2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 0 deletions

View File

@ -18,6 +18,9 @@ class GroundSpeed:
# on fuel, but mission speed will be fast enough to keep the flight
# safer.
if flight.squadron.aircraft.cruise_speed is not None:
return mach(flight.squadron.aircraft.cruise_speed.mach(), altitude)
# DCS's max speed is in kph at 0 MSL.
max_speed = flight.unit_type.max_speed
if max_speed > SPEED_OF_SOUND_AT_SEA_LEVEL:

View File

@ -182,6 +182,9 @@ class AircraftType(UnitType[Type[FlyingType]]):
#: planner will consider this aircraft usable for a mission.
max_mission_range: Distance
#: Speed used for TOT calculations
cruise_speed: Optional[Speed]
fuel_consumption: Optional[FuelConsumption]
default_livery: Optional[str]
@ -495,6 +498,9 @@ class AircraftType(UnitType[Type[FlyingType]]):
patrol_altitude=patrol_config.altitude,
patrol_speed=patrol_config.speed,
max_mission_range=mission_range,
cruise_speed=knots(data["cruise_speed_kt_indicated"])
if "cruise_speed_kt_indicated" in data
else None,
fuel_consumption=fuel_consumption,
default_livery=data.get("default_livery"),
intra_flight_radio=radio_config.intra_flight,

View File

@ -19,6 +19,7 @@ manufacturer: Boeing
origin: USA
price: 20
role: Attack
cruise_speed_kt_indicated: 120
variants:
AH-64D Apache Longbow: {}
radios: