Skip to content

Conversation

Fly-Star-him
Copy link
Contributor

Units that have already died enter auto-target checking, which can cause some issues, so try to fix them.
已经死亡的单位会进入自动索敌检查,它们可能会造成一些问题,因此尝试修复。

@Fly-Star-him Fly-Star-him added Minor Minor feature and/or fix, not a lot of changes or they are not significant Needs testing labels Oct 11, 2025
Copy link

github-actions bot commented Oct 11, 2025

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.

Copy link
Contributor

@CrimRecya CrimRecya left a 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.

@Fly-Star-him
Copy link
Contributor Author

Fly-Star-him commented Oct 12, 2025

They were always here. All I did was rearrange them to prevent accidents.

@Fly-Star-him Fly-Star-him changed the title [Minor] Auto Target Extension - Prioritize checking if the target is dead [Minor] Auto Target Fix - Prioritize checking if the target is dead Oct 12, 2025
Copy link
Contributor

@CrimRecya CrimRecya left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Minor Minor feature and/or fix, not a lot of changes or they are not significant Needs testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants