Changed NearestAttackableUnitInObjectRangeCheck to only consider neutral units as targets if they are already in combat with target searching unit

This commit is contained in:
hondacrx
2017-09-20 00:28:17 -04:00
parent 1b9bf99d8c
commit 87e0b1a603
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ namespace Game.AI
me.IsFriendlyTo(victim) || !me.CanSeeOrDetect(victim))
{
victim = null;
var u_check = new NearestAttackableUnitInObjectRangeCheck(me, me, max_range);
var u_check = new NearestAttackableUnitInObjectRangeCheck(me, me.GetCharmerOrOwnerOrSelf(), max_range);
var checker = new UnitLastSearcher(me, u_check);
Cell.VisitAllObjects(me, checker, max_range);
victim = checker.GetTarget();