Make Tick return bool

This commit is contained in:
tovl
2019-05-14 21:13:25 +02:00
committed by teinarss
parent 09c1611239
commit 3790169db9
49 changed files with 328 additions and 318 deletions

View File

@@ -46,13 +46,13 @@ namespace OpenRA.Mods.Cnc.Traits
this.forceAttack = forceAttack;
}
public override Activity Tick(Actor self)
public override bool Tick(Actor self)
{
if (IsCanceling || !target.IsValidFor(self))
return NextActivity;
return true;
if (attack.IsTraitDisabled)
return this;
return false;
var weapon = attack.ChooseArmamentsForTarget(target, forceAttack).FirstOrDefault();
if (weapon != null)
@@ -60,13 +60,13 @@ namespace OpenRA.Mods.Cnc.Traits
// Check that AttackTDGunboatTurreted hasn't cancelled the target by modifying attack.Target
// Having both this and AttackTDGunboatTurreted modify that field is a horrible hack.
if (hasTicked && attack.RequestedTarget.Type == TargetType.Invalid)
return NextActivity;
return true;
attack.SetRequestedTarget(self, target);
hasTicked = true;
}
return NextActivity;
return true;
}
}
}