Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to deserialize missions containing RecoveryTanker tasks #363

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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=None, speed=600, altitude=4000, lastWaypoint: Optional[int] = None):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't delete the type annotations. You've changed this signature from float to int here.

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
Loading