-
-
Notifications
You must be signed in to change notification settings - Fork 117
[Minor] Auto Target Fix - Prioritize checking if the target is dead #1908
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
base: develop
Are you sure you want to change the base?
[Minor] Auto Target Fix - Prioritize checking if the target is dead #1908
Conversation
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is an invalid fix. All places where this function is called have already used the pTarget
pointer to call virtual functions. So if this issue cannot be solved from the root, then it cannot be placed here either. You should make these sanity check before calling IsAlliedWith
which has called GetOwningHouse
.
Moreover, I think that this fix will affect the performance of the enemy searching and will not occur frequently. A switch should be set to disabled this fix by applying patch.
They were always here. All I did was rearrange them to prevent accidents. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks fine now, but I still hope it can be turned off by Patch::Apply_RAW
like DisableRadDamageOnBuildings
, as in most cases these hooks are not needed.
Units that have already died enter auto-target checking, which can cause some issues, so try to fix them.
已经死亡的单位会进入自动索敌检查,它们可能会造成一些问题,因此尝试修复。