Guard the trait lookup.
This commit is contained in:
committed by
Gustas
parent
25dd0508c2
commit
41f28f2519
@@ -183,7 +183,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (modifiers.HasModifier(TargetModifiers.ForceAttack) && !string.IsNullOrEmpty(info.ForceSetType))
|
if (modifiers.HasModifier(TargetModifiers.ForceAttack) && !string.IsNullOrEmpty(info.ForceSetType))
|
||||||
{
|
{
|
||||||
var closest = self.World.Selection.Actors
|
var closest = self.World.Selection.Actors
|
||||||
.Where(a => a.TraitOrDefault<RallyPoint>()?.Info.ForceSetType == info.ForceSetType)
|
.Where(a => !a.IsDead && a.IsInWorld && a.TraitOrDefault<RallyPoint>()?.Info.ForceSetType == info.ForceSetType)
|
||||||
.ClosestToIgnoringPath(target.CenterPosition);
|
.ClosestToIgnoringPath(target.CenterPosition);
|
||||||
|
|
||||||
ForceSet = closest == self;
|
ForceSet = closest == self;
|
||||||
|
|||||||
Reference in New Issue
Block a user