Drop invisible invalid targets immediately when changing stance
This commit is contained in:
@@ -364,7 +364,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (newStance > oldStance || forceAttack)
|
||||
return;
|
||||
|
||||
if (!autoTarget.HasValidTargetPriority(self, lastVisibleOwner, lastVisibleTargetTypes))
|
||||
// If lastVisibleTarget is invalid we could never view the target in the first place, so we just drop it here too
|
||||
if (!lastVisibleTarget.IsValidFor(self) || !autoTarget.HasValidTargetPriority(self, lastVisibleOwner, lastVisibleTargetTypes))
|
||||
attack.ClearRequestedTarget();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user