Remove invalid squad members before responding to attack.
This commit is contained in:
committed by
Gustas
parent
ff276b4877
commit
822a29aa76
@@ -476,6 +476,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
var protectSq = GetSquadOfType(SquadType.Protection);
|
var protectSq = GetSquadOfType(SquadType.Protection);
|
||||||
protectSq ??= RegisterNewSquad(bot, SquadType.Protection, (attacker, WVec.Zero));
|
protectSq ??= RegisterNewSquad(bot, SquadType.Protection, (attacker, WVec.Zero));
|
||||||
|
protectSq.Units.RemoveWhere(unitCannotBeOrdered);
|
||||||
|
|
||||||
if (protectSq.IsValid && !protectSq.IsTargetValid(protectSq.CenterUnit()))
|
if (protectSq.IsValid && !protectSq.IsTargetValid(protectSq.CenterUnit()))
|
||||||
protectSq.SetActorToTarget((attacker, WVec.Zero));
|
protectSq.SetActorToTarget((attacker, WVec.Zero));
|
||||||
|
|||||||
Reference in New Issue
Block a user