fix(Core/Combat): let asymmetric-faction aggressors engage friendly-back targets (#26194)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
blinkysc
2026-06-14 17:51:09 -05:00
committed by GitHub
parent 133167b0ae
commit 4a4de647cb
2 changed files with 45 additions and 1 deletions

View File

@@ -59,7 +59,8 @@
// ... both units must be allowed to enter combat
if (a->IsCombatDisallowed() || b->IsCombatDisallowed())
return false;
if (a->IsFriendlyTo(b) || b->IsFriendlyTo(a))
// ...not friendly, unless one side is hostile (asymmetric aggressor wins)
if ((a->IsFriendlyTo(b) || b->IsFriendlyTo(a)) && !a->IsHostileTo(b) && !b->IsHostileTo(a))
return false;
Player const* playerA = a->GetCharmerOrOwnerPlayerOrPlayerItself();
Player const* playerB = b->GetCharmerOrOwnerPlayerOrPlayerItself();