Fix engagement distance display.

This commit is contained in:
Dan Albert 2021-06-09 20:59:14 -07:00
parent 66f82b6ff9
commit a9dacf4a29

View File

@ -508,14 +508,12 @@ class FlightJs(QObject):
flight: Flight, flight: Flight,
selected: bool, selected: bool,
theater: ConflictTheater, theater: ConflictTheater,
faction: Faction,
ato_model: AtoModel, ato_model: AtoModel,
) -> None: ) -> None:
super().__init__() super().__init__()
self.flight = flight self.flight = flight
self._selected = selected self._selected = selected
self.theater = theater self.theater = theater
self.faction = faction
self.ato_model = ato_model self.ato_model = ato_model
self._waypoints = self.make_waypoints() self._waypoints = self.make_waypoints()
@ -562,8 +560,7 @@ class FlightJs(QObject):
ShapelyPoint(end.x, end.y), ShapelyPoint(end.x, end.y),
] ]
) )
doctrine = self.faction.doctrine bubble = line.buffer(self.flight.flight_plan.engagement_distance.meters)
bubble = line.buffer(doctrine.cap_engagement_range.meters)
return shapely_poly_to_leaflet_points(bubble, self.theater) return shapely_poly_to_leaflet_points(bubble, self.theater)
@ -855,7 +852,6 @@ class MapModel(QObject):
flight, flight,
selected=blue and (p_idx, f_idx) == self._selected_flight_index, selected=blue and (p_idx, f_idx) == self._selected_flight_index,
theater=self.game.theater, theater=self.game.theater,
faction=self.game.faction_for(blue),
ato_model=self.game_model.ato_model_for(blue), ato_model=self.game_model.ato_model_for(blue),
) )
) )