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

Fix AutoTarget overriding demoted targets #16551

merged 2 commits into from May 19, 2019


Copy link

commented May 17, 2019

This PR fixes AutoTarget overriding targets that were initially ordered normally but then demoted to opportunity targets by the player issuing a different order. The unit will now keep its original target unless explicitly stopped (S or command bar) or moved out of range.

Fixes #16309 and hopefully all other complaints about the opportunity fire logic working unexpectedly.

I had initially implemented this using conditions to disable AutoTarget, but this requires a bunch of awkward and fragile yaml overrides to grant a condition on all units that inherit from AttackFollow to disable AutoTarget. The underlying bug is caused by a hardcoded check that assumes idle == ok to assign a new target, so IMO there is no real issue with fixing this using an interface.

@pchote pchote added this to the Next Release milestone May 17, 2019

Replace IPreventsAutoTarget with IDisable(Enemy)AutoTarget.
This allows traits on the attacking unit to suppress auto targeting
and makes the distinction between the two interfaces clear.

@pchote pchote force-pushed the pchote:fix-autotarget-opportunity-override branch from 6bacc9d to c3d75b0 May 17, 2019

@pchote pchote force-pushed the pchote:fix-autotarget-opportunity-override branch from c3d75b0 to 06e1ced May 17, 2019

Punsho approved these changes May 18, 2019
Copy link

left a comment

Fixes the bug

@pchote pchote added the PR: Needs +2 label May 18, 2019

@abcdefg30 abcdefg30 merged commit 44c5d38 into OpenRA:bleed May 19, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed

This comment has been minimized.

Copy link

commented May 19, 2019

@pchote pchote deleted the pchote:fix-autotarget-opportunity-override branch Aug 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.