Skip to content

Commit

Permalink
Merge pull request OpenRA#6905 from LipkeGu/Dont_query_traits_on_dead…
Browse files Browse the repository at this point in the history
…_units

AnyUnitsAt: Ignore Units which are Destroyed
  • Loading branch information
chrisforbes committed Nov 11, 2014
2 parents 08f5081 + ae4ee09 commit 5510001
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions OpenRA.Game/Traits/World/ActorMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,8 @@ public bool AnyUnitsAt(CPos a, SubCell sub, Func<Actor, bool> withCondition)

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;
}
Expand Down

0 comments on commit 5510001

Please sign in to comment.