mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Make waypoint types less error prone.
Make the type of the waypoint a non-optional part of the constructor. Every waypoint needs a type, and there's no good default (the previous default, `TAKEOFF`, is actually unused). All of the target waypoints were mistakenly being set as `TAKEOFF`, so I've fixed that in the process. Also, fix the bug where only the last custom target of a SEAD objective was being added to the waypoint list because the append was scoped incorrectly.
This commit is contained in:
@@ -60,7 +60,9 @@ class PredefinedWaypointCategory(Enum):
|
||||
|
||||
class FlightWaypoint:
|
||||
|
||||
def __init__(self, x: float, y: float, alt=0):
|
||||
def __init__(self, waypoint_type: FlightWaypointType, x: float, y: float,
|
||||
alt: int = 0) -> None:
|
||||
self.waypoint_type = waypoint_type
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.alt = alt
|
||||
@@ -71,8 +73,7 @@ class FlightWaypoint:
|
||||
self.targetGroup = None
|
||||
self.obj_name = ""
|
||||
self.pretty_name = ""
|
||||
self.waypoint_type = FlightWaypointType.TAKEOFF # type: FlightWaypointType
|
||||
self.category = PredefinedWaypointCategory.NOT_PREDEFINED# type: PredefinedWaypointCategory
|
||||
self.category: PredefinedWaypointCategory = PredefinedWaypointCategory.NOT_PREDEFINED
|
||||
self.only_for_player = False
|
||||
self.data = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user