move counter-capture logic down into Capturable; remove spurious interlock on CaptureInProgress
This commit is contained in:
@@ -32,10 +32,6 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
if ((nearest - mobile.toCell).LengthSquared > 2)
|
if ((nearest - mobile.toCell).LengthSquared > 2)
|
||||||
return Util.SequenceActivities(new MoveAdjacentTo(Target.FromActor(target)), this);
|
return Util.SequenceActivities(new MoveAdjacentTo(Target.FromActor(target)), this);
|
||||||
|
|
||||||
var capturable = target.TraitOrDefault<Capturable>();
|
|
||||||
if (capturable != null && capturable.CaptureInProgress && capturable.Captor.Owner.Stances[self.Owner] == Stance.Ally)
|
|
||||||
return NextActivity;
|
|
||||||
|
|
||||||
if (!target.Trait<Capturable>().BeginCapture(target, self))
|
if (!target.Trait<Capturable>().BeginCapture(target, self))
|
||||||
return NextActivity;
|
return NextActivity;
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,10 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
public bool BeginCapture(Actor self, Actor captor)
|
public bool BeginCapture(Actor self, Actor captor)
|
||||||
{
|
{
|
||||||
if (!self.Trait<Building>().Lock())
|
if (!CaptureInProgress && !self.Trait<Building>().Lock())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (CaptureInProgress && Captor.Owner.Stances[captor.Owner] == Stance.Ally)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
CaptureProgressTime = 0;
|
CaptureProgressTime = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user