mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Now possible to create/delete flights.
This commit is contained in:
@@ -330,6 +330,18 @@ class AircraftConflictGenerator:
|
||||
self.setup_group_as_sead_flight(group, flight)
|
||||
self._setup_custom_payload(flight, group)
|
||||
|
||||
for flight in flight_planner.custom_flights:
|
||||
group = self.generate_planned_flight(cp, country, flight)
|
||||
if flight.flight_type == FlightType.INTERCEPTION:
|
||||
self.setup_group_as_intercept_flight(group, flight)
|
||||
elif flight.flight_type == FlightType.CAP:
|
||||
self.setup_group_as_cap_flight(group, flight)
|
||||
elif flight.flight_type == FlightType.CAS:
|
||||
self.setup_group_as_cas_flight(group, flight)
|
||||
elif flight.flight_type == FlightType.SEAD or flight.flight_type == FlightType.DEAD:
|
||||
self.setup_group_as_sead_flight(group, flight)
|
||||
self._setup_custom_payload(flight, group)
|
||||
|
||||
def generate_planned_flight(self, cp, country, flight:Flight):
|
||||
try:
|
||||
if flight.start_type == "In Flight" or flight.client_count == 0:
|
||||
|
||||
@@ -29,6 +29,7 @@ class FlightPlanner:
|
||||
cas_flights = []
|
||||
strike_flights = []
|
||||
sead_flights = []
|
||||
custom_flights = []
|
||||
flights = []
|
||||
|
||||
potential_sead_targets = []
|
||||
@@ -75,6 +76,20 @@ class FlightPlanner:
|
||||
|
||||
# TODO : commision STRIKE / ANTISHIP
|
||||
|
||||
def remove_flight(self, index):
|
||||
try:
|
||||
flight = self.flights[index]
|
||||
if flight in self.interceptor_flights: self.interceptor_flights.remove(flight)
|
||||
if flight in self.cap_flights: self.cap_flights.remove(flight)
|
||||
if flight in self.cas_flights: self.cas_flights.remove(flight)
|
||||
if flight in self.strike_flights: self.strike_flights.remove(flight)
|
||||
if flight in self.sead_flights: self.sead_flights.remove(flight)
|
||||
if flight in self.custom_flights: self.custom_flights.remove(flight)
|
||||
self.flights.remove(flight)
|
||||
except IndexError:
|
||||
return
|
||||
|
||||
|
||||
def commision_interceptors(self):
|
||||
"""
|
||||
Pick some aircraft to assign them to interception roles
|
||||
|
||||
Reference in New Issue
Block a user