mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Move FlightJs out of MapModel.
This commit is contained in:
@@ -17,8 +17,13 @@ class AirTaskingOrder:
|
||||
|
||||
def remove_package(self, package: Package) -> None:
|
||||
"""Removes a package from the ATO."""
|
||||
# Remove all the flights individually so the database gets updated.
|
||||
for flight in list(package.flights):
|
||||
package.remove_flight(flight)
|
||||
self.packages.remove(package)
|
||||
|
||||
def clear(self) -> None:
|
||||
"""Removes all packages from the ATO."""
|
||||
self.packages.clear()
|
||||
# Remove all packages individually so the database gets updated.
|
||||
for package in self.packages:
|
||||
self.remove_package(package)
|
||||
|
||||
@@ -22,7 +22,7 @@ class Navigating(InFlight):
|
||||
self, events: GameUpdateEvents, time: datetime, duration: timedelta
|
||||
) -> None:
|
||||
super().on_game_tick(events, time, duration)
|
||||
events.update_flight(self.flight, self.estimate_position())
|
||||
events.update_flight_position(self.flight, self.estimate_position())
|
||||
|
||||
def progress(self) -> float:
|
||||
return (
|
||||
|
||||
@@ -129,6 +129,9 @@ class Package:
|
||||
"""Removes a flight from the package."""
|
||||
self.flights.remove(flight)
|
||||
self._db.remove(flight.id)
|
||||
flight.return_pilots_and_aircraft()
|
||||
if flight.cargo is not None:
|
||||
flight.cargo.transport = None
|
||||
if not self.flights:
|
||||
self.waypoints = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user