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

Filter damaged ships from airbase export #249

Merged
merged 3 commits into from
Jan 9, 2024

Conversation

mobot-gh
Copy link
Contributor

@mobot-gh mobot-gh commented Dec 6, 2023

Due to the fact that:

  1. DCS treats ships as airbases.
  2. DCS removes units from groups when they are critically damaged but not yet destroyed, and changes them to static objects.

The getAirbases method from WorldService can fail with an error if it is called while a ship is in this static state, as the exporter attempts to access the group the airbase unit belongs to, which does not exist.

This PR filters out these static ships by performing nil checks for the unit & group before attempting to export.

Copy link
Contributor

@rurounijones rurounijones left a comment

Choose a reason for hiding this comment

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

Could you add an entry into the CHANGELOG with details of the fix, then we can merge.

@mobot-gh
Copy link
Contributor Author

As main has been updated is it cleaner to close this request, rebase, and open a new PR, or is it okay to push a slightly modified history to this PR, or will you resolve it manually (single change in CHANGELOG.md)?

@rurounijones
Copy link
Contributor

rurounijones commented Dec 16, 2023

Could you rebase this brqnch on main and fix the conflict, then I can merge.

@rurounijones rurounijones merged commit 4f37a10 into DCS-gRPC:main Jan 9, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants