Fix helicopters oscillating due to over-speeding

This commit is contained in:
Raffson 2023-08-13 19:53:38 +02:00
parent 1157d264ee
commit 270301958a
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
3 changed files with 5 additions and 4 deletions

View File

@ -19,6 +19,7 @@
* **[Payloads]** Added/Updated (missing) payloads * **[Payloads]** Added/Updated (missing) payloads
* **[Aircraft Tasking]** Revised aircraft tasking, filtering out incompatible tasks for several aircraft * **[Aircraft Tasking]** Revised aircraft tasking, filtering out incompatible tasks for several aircraft
* **[Data]** Corrected the class of the USS Samuel Chase from Logistics to LandingShip, in order to prevent it being spawned as part of AAA sites. * **[Data]** Corrected the class of the USS Samuel Chase from Logistics to LandingShip, in order to prevent it being spawned as part of AAA sites.
* **[Mission Generation]** Helicopters oscillating due to over-speeding
# Retribution v1.2.1 (hotfix) # Retribution v1.2.1 (hotfix)

View File

@ -39,7 +39,7 @@ class GroundSpeed:
# as it can at sea level. This probably isn't great assumption, but # as it can at sea level. This probably isn't great assumption, but
# might. be sufficient given the wiggle room. We can come up with # might. be sufficient given the wiggle room. We can come up with
# another heuristic if needed. # another heuristic if needed.
cruise_mach = max_speed.mach() * 0.85 cruise_mach = max_speed.mach() * (0.65 if flight.is_helo else 0.85)
return mach(cruise_mach, altitude) return mach(cruise_mach, altitude)

View File

@ -292,9 +292,9 @@ class AircraftType(UnitType[Type[FlyingType]]):
) )
else: else:
# Slow like warbirds or helicopters # Slow like warbirds or helicopters
# Use whichever is slowest - mach 0.35 or 70% of max speed # Use whichever is slowest - mach 0.35 or 50% of max speed
logging.debug(f"{self.name} max_speed * 0.7 is {max_speed * 0.7}") logging.debug(f"{self.name} max_speed * 0.5 is {max_speed * 0.5}")
return min(Speed.from_mach(0.35, altitude), max_speed * 0.7) return min(Speed.from_mach(0.35, altitude), max_speed * 0.5)
def alloc_flight_radio(self, radio_registry: RadioRegistry) -> RadioFrequency: def alloc_flight_radio(self, radio_registry: RadioRegistry) -> RadioFrequency:
from game.radio.radios import ChannelInUseError, kHz from game.radio.radios import ChannelInUseError, kHz