From aeadf4342580c0499bd552430f405e15aff4cd41 Mon Sep 17 00:00:00 2001 From: Bragin Stepan Date: Fri, 13 Mar 2026 15:36:04 +0500 Subject: [PATCH] fix: logic team selector --- .../Features/Selectors/LowestHealthTargetSelector.cs | 4 +++- .../Features/Selectors/NearestDamageableTargetSelector.cs | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Selectors/LowestHealthTargetSelector.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Selectors/LowestHealthTargetSelector.cs index 781a0a1..3715c99 100644 --- a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Selectors/LowestHealthTargetSelector.cs +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Selectors/LowestHealthTargetSelector.cs @@ -51,7 +51,9 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Selectors if (target.TryGetCanApplyDamage(out ICompositeCondition value)) result = result && value.Evaluate(); - result = result && (target != _source); + result = result + && (target != _source) + && (EntitiesHelper.AreOnSameTeam(_source, target) == false); return result; }); diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Selectors/NearestDamageableTargetSelector.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Selectors/NearestDamageableTargetSelector.cs index ddb335e..2843f64 100644 --- a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Selectors/NearestDamageableTargetSelector.cs +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Selectors/NearestDamageableTargetSelector.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using _Project.Develop.Runtime.Entities; using _Project.Develop.Runtime.Logic.Gameplay.Features.AI.States; @@ -54,7 +54,9 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Selectors if (target.TryGetCanApplyDamage(out ICompositeCondition value)) result = result && value.Evaluate(); - result = result && (target != _source); + result = result + && (target != _source) + && (EntitiesHelper.AreOnSameTeam(_source, target) == false); return result; });