Skip to content

Commit

Permalink
Make it possible to deserialize missions containing RecoveryTanker tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
magwo committed Jan 29, 2024
1 parent 677a6f2 commit 6d1f0d8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dcs/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ def __init__(self):
class RecoveryTanker(Task):
Id = "RecoveryTanker"

def __init__(self, groupId: int, speed: float, altitude: float, lastWaypoint: Optional[int]):
def __init__(self, groupId: int=None, speed=600, altitude=4000, lastWaypoint: Optional[int]=None):
super(RecoveryTanker, self).__init__(RecoveryTanker.Id)

speedEdited = True
Expand All @@ -753,7 +753,6 @@ def __init__(self, groupId: int, speed: float, altitude: float, lastWaypoint: Op

self.params = {
"speedEdited": speedEdited,
"groupId": groupId,
"altitudeEdited": altitudeEdited,
"altitude": altitude,
"targetTypes": {
Expand All @@ -764,6 +763,8 @@ def __init__(self, groupId: int, speed: float, altitude: float, lastWaypoint: Op
"lastWptIndexFlagChangedManually": lastWptIndexChangedManually,
"lastWptIndex": lastWaypoint,
}
if groupId is not None:
self.params["groupId"] = groupId


class OrbitAction(Task):
Expand Down Expand Up @@ -1129,6 +1130,7 @@ def __init__(self, alt_above: int = DEFAULT_ALT,
AWACSTaskAction.Id: AWACSTaskAction,
RefuelingTaskAction.Id: RefuelingTaskAction,
Tanker.Id: Tanker,
RecoveryTanker.Id: RecoveryTanker,
OrbitAction.Id: OrbitAction,
Follow.Id: Follow,
Aerobatics.Id: Aerobatics,
Expand Down

0 comments on commit 6d1f0d8

Please sign in to comment.