Always use altitude in GroundSpeed.for_flight

This commit is contained in:
Raffson 2024-07-21 21:39:24 +02:00
parent 7ea1569f22
commit 2b65d2f800
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99

View File

@ -3,7 +3,7 @@ from __future__ import annotations
from datetime import datetime
from typing import TYPE_CHECKING
from game.utils import Distance, SPEED_OF_SOUND_AT_SEA_LEVEL, Speed, mach, meters
from game.utils import Distance, SPEED_OF_SOUND_AT_SEA_LEVEL, Speed, mach
if TYPE_CHECKING:
from .flight import Flight
@ -31,7 +31,7 @@ class GroundSpeed:
# might. be sufficient given the wiggle room. We can come up with
# another heuristic if needed.
cruise_mach = max_speed.mach() * (0.7 if flight.is_helo else 0.85)
return mach(cruise_mach, altitude if not flight.is_helo else meters(0))
return mach(cruise_mach, altitude)
# TODO: Most if not all of this should move into FlightPlan.