Rename 'unit' to 'victim' in CEWH's GetDirectHit check

This commit is contained in:
reaperrr
2016-04-26 18:02:08 +02:00
parent fe7fe9b49b
commit 3aa811bd2e

View File

@@ -75,17 +75,17 @@ namespace OpenRA.Mods.Common.Warheads
public bool GetDirectHit(World world, CPos cell, WPos pos, Actor firedBy, bool checkTargetType = false) public bool GetDirectHit(World world, CPos cell, WPos pos, Actor firedBy, bool checkTargetType = false)
{ {
foreach (var unit in world.FindActorsInCircle(pos, TargetSearchRadius)) foreach (var victim in world.FindActorsInCircle(pos, TargetSearchRadius))
{ {
if (checkTargetType && !IsValidAgainst(unit, firedBy)) if (checkTargetType && !IsValidAgainst(victim, firedBy))
continue; continue;
var healthInfo = unit.Info.TraitInfoOrDefault<HealthInfo>(); var healthInfo = victim.Info.TraitInfoOrDefault<HealthInfo>();
if (healthInfo == null) if (healthInfo == null)
continue; continue;
// If the impact position is within any actor's HitShape, we have a direct hit // If the impact position is within any actor's HitShape, we have a direct hit
if (healthInfo.Shape.DistanceFromEdge(pos, unit).Length <= 0) if (healthInfo.Shape.DistanceFromEdge(pos, victim).Length <= 0)
return true; return true;
} }