Use stacking algorithm in "_generate_over_departure"

Resolves #57

"_generate_over_departure" is the method used to generate flights in the air when no more parking spots are available. Pydcs changes were required as it turned out aircraft were trying to spawn on helicopter parking spots, which forces them to start in the air by DCS itself.
This commit is contained in:
Raffson 2023-01-01 16:53:18 +01:00
parent 9ddaf50ad4
commit 37f2e5bf3a
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
2 changed files with 6 additions and 3 deletions

View File

@ -135,7 +135,6 @@ class FlightGroupSpawner:
"No room on runway or parking slots. Starting from the air." "No room on runway or parking slots. Starting from the air."
) )
group = self._generate_over_departure(name, cp) group = self._generate_over_departure(name, cp)
group.points[0].alt = 1500
return group return group
def generate_mid_mission(self) -> FlyingGroup[Any]: def generate_mid_mission(self) -> FlyingGroup[Any]:
@ -208,7 +207,11 @@ class FlightGroupSpawner:
elif self.flight.unit_type.helicopter: elif self.flight.unit_type.helicopter:
alt = WARM_START_HELI_ALT alt = WARM_START_HELI_ALT
else: else:
alt = WARM_START_ALTITUDE if origin.id not in self.mission_data.cp_stack:
min_alt = MINIMUM_MID_MISSION_SPAWN_ALTITUDE_AGL
self.mission_data.cp_stack[origin.id] = min_alt
alt = self.mission_data.cp_stack[origin.id]
self.mission_data.cp_stack[origin.id] += STACK_SEPARATION
speed = GroundSpeed.for_flight(self.flight, alt) speed = GroundSpeed.for_flight(self.flight, alt)
pos = at + Vector2(random.randint(100, 1000), random.randint(100, 1000)) pos = at + Vector2(random.randint(100, 1000), random.randint(100, 1000))

View File

@ -31,7 +31,7 @@ platformdirs==2.5.4
pluggy==1.0.0 pluggy==1.0.0
pre-commit==2.20.0 pre-commit==2.20.0
pydantic==1.10.2 pydantic==1.10.2
-e git+https://github.com/dcs-retribution/pydcs@fb1fefcb32fbab82ac36b8519b87bae32326784e#egg=pydcs -e git+https://github.com/dcs-retribution/pydcs@1016e803396f676471286f928577d97d717352a4#egg=pydcs
pyinstaller==5.6.2 pyinstaller==5.6.2
pyinstaller-hooks-contrib==2022.13 pyinstaller-hooks-contrib==2022.13
pyparsing==3.0.9 pyparsing==3.0.9