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

Prevent droids from ramming into targets when set to "Optimum Range" #3317

Merged
merged 1 commit into from
Jul 23, 2023

Conversation

DARwins1
Copy link
Member

@DARwins1 DARwins1 commented Jul 20, 2023

Fixes #1201 (hopefully)
This should stop units that are set to "Optimum Range" from continuing to approach their target until they literally ram into it.
Currently units set to optimum range that are between their short and long ranges (if their short range accuracy is greater) will constantly switch between DACTION_ATTACK and DACTION_MOVETOATTACK. If the unit happens to be in DACTION_ATTACK when it crosses the short range threshold, it won't recognize that it's close enough and continue to drive towards the target.
This PR makes it so that units set to optimum range will stay in DACTION_MOVETOATTACK while moving closer and firing, and correctly stop moving and switch to DACTION_ATTACK when entering their preferred range.
This seems to fix the issue without causing any unintentional effects, but more testing is always appreciated.

@past-due past-due added this to the 4.4.0-beta1 milestone Jul 22, 2023
@KJeff01 KJeff01 merged commit 4129da7 into Warzone2100:master Jul 23, 2023
@DARwins1 DARwins1 deleted the dr-8 branch August 5, 2023 20:10
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.

Units occasionally move to point-blank range
3 participants