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

Cache hit chance when sorting the list of potential targets in tactical and ensure the sorted order matches the order of TAB-cycling #1387

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Iridar
Copy link
Contributor

@Iridar Iridar commented Sep 8, 2024

Fixes #1233
Alternative implementation of #1234

Differences: moved the sorting into a separate function, added some code to fix the "bug" where the order of TAB-cycling through targets does not always the match the order of displayed target icons for targets that have the same hit chance.

I separated them into two commits so that the TAB-cycling functionality is easier to see during the review.

I added HL-Docs for this issue as if it's a bugfix, not sure how correct is that, but I figured there's nothing about this change that needs to be mod-dev facing, as it's mostly an optimization change.

@Iridar Iridar added enhancement ready-to-review A pull request is ready to be reviewed labels Sep 8, 2024
@Iridar Iridar added this to the 1.29.0 milestone Sep 8, 2024
@Iridar Iridar self-assigned this Sep 8, 2024
@Iridar Iridar changed the title 1233 cache enemy sort Cache hit chance when sorting the list of potential targets in tactical and ensure the sorted order matches the order of TAB-cycling Sep 8, 2024
…ets matches the displayed order of target icons
@Iridar
Copy link
Contributor Author

Iridar commented Sep 8, 2024

Tested in lab conditions, tutorial, and first mission afterwards. Seems to work fine.

@Iridar
Copy link
Contributor Author

Iridar commented Sep 12, 2024

This needs testing with various targetable interactive objects, such as explosive barrels and psi nodes on the Sabotage Psi Emitter mission. Make sure the order of displayed icons matches the order of clicking on the icon or using an ability to enter targeting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ready-to-review A pull request is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UITacticalHUD_Enemies UpdateVisibleEnemies should use cached hit chances when sorting final targets array
2 participants