mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Include positions of dead aircraft for the UI.
This commit is contained in:
parent
895a4eb0dc
commit
453f6ac74a
@ -6,6 +6,7 @@ from uuid import UUID
|
||||
from pydantic import BaseModel
|
||||
|
||||
from game.ato.flightstate import InFlight
|
||||
from game.ato.flightstate.killed import Killed
|
||||
from game.server.leaflet import LeafletPoint
|
||||
from game.server.waypoints.models import FlightWaypointJs
|
||||
from game.server.waypoints.routes import waypoints_for_flight
|
||||
@ -29,10 +30,13 @@ class FlightJs(BaseModel):
|
||||
def for_flight(flight: Flight, with_waypoints: bool) -> FlightJs:
|
||||
# Don't provide a location for aircraft that aren't in the air. Later we can
|
||||
# expand the model to include the state data for the UI so that it can make its
|
||||
# own decisions about whether or not to draw the aircraft, but for now we'll
|
||||
# filter here.
|
||||
# own decisions about whether to draw the aircraft, but for now we'll filter
|
||||
# here.
|
||||
#
|
||||
# We also draw dead aircraft so the player has some feedback about what's being
|
||||
# lost.
|
||||
position = None
|
||||
if isinstance(flight.state, InFlight):
|
||||
if isinstance(flight.state, InFlight) or isinstance(flight.state, Killed):
|
||||
position = flight.position().latlng()
|
||||
waypoints = None
|
||||
if with_waypoints:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user