Merge pull request #6905 from LipkeGu/Dont_query_traits_on_dead_units

AnyUnitsAt: Ignore Units which are Destroyed
This commit is contained in:
Chris Forbes
2014-11-12 08:06:58 +13:00

View File

@@ -281,9 +281,8 @@ namespace OpenRA.Traits
var always = sub == SubCell.FullCell || sub == SubCell.Any;
for (var i = influence[a]; i != null; i = i.Next)
if (always || i.SubCell == sub || i.SubCell == SubCell.FullCell)
if (withCondition(i.Actor))
return true;
if ((always || i.SubCell == sub || i.SubCell == SubCell.FullCell) && !i.Actor.Destroyed && withCondition(i.Actor))
return true;
return false;
}