Activity.Cancel returns void instead of bool.
This commit is contained in:
@@ -206,12 +206,12 @@ namespace OpenRA.Mods.Common.Activities
|
||||
});
|
||||
}
|
||||
|
||||
public override bool Cancel(Actor self, bool keepQueue = false)
|
||||
public override void Cancel(Actor self, bool keepQueue = false)
|
||||
{
|
||||
if (!IsCanceling && innerActivity != null)
|
||||
innerActivity.Cancel(self);
|
||||
|
||||
return base.Cancel(self);
|
||||
base.Cancel(self);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,14 +160,14 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return this;
|
||||
}
|
||||
|
||||
public override bool Cancel(Actor self, bool keepQueue = false)
|
||||
public override void Cancel(Actor self, bool keepQueue = false)
|
||||
{
|
||||
OnCancel(self);
|
||||
|
||||
if (!IsCanceling && moveActivity != null)
|
||||
moveActivity.Cancel(self);
|
||||
|
||||
return base.Cancel(self, keepQueue);
|
||||
base.Cancel(self, keepQueue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,12 +133,12 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
public override bool Cancel(Actor self, bool keepQueue = false)
|
||||
public override void Cancel(Actor self, bool keepQueue = false)
|
||||
{
|
||||
if (!IsCanceling && enterTransport != null)
|
||||
enterTransport.Cancel(self);
|
||||
|
||||
return base.Cancel(self, keepQueue);
|
||||
base.Cancel(self, keepQueue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,10 +81,10 @@ namespace OpenRA.Mods.Common.Activities
|
||||
throw new InvalidOperationException("Invalid harvester dock state");
|
||||
}
|
||||
|
||||
public override bool Cancel(Actor self, bool keepQueue = false)
|
||||
public override void Cancel(Actor self, bool keepQueue = false)
|
||||
{
|
||||
dockingState = DockingState.Undock;
|
||||
return base.Cancel(self);
|
||||
base.Cancel(self);
|
||||
}
|
||||
|
||||
public override IEnumerable<Target> GetTargets(Actor self)
|
||||
|
||||
@@ -46,12 +46,12 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return this;
|
||||
}
|
||||
|
||||
public override bool Cancel(Actor self, bool keepQueue = false)
|
||||
public override void Cancel(Actor self, bool keepQueue = false)
|
||||
{
|
||||
if (!IsCanceling && inner != null)
|
||||
inner.Cancel(self);
|
||||
|
||||
return base.Cancel(self, keepQueue);
|
||||
base.Cancel(self, keepQueue);
|
||||
}
|
||||
|
||||
public override IEnumerable<Target> GetTargets(Actor self)
|
||||
|
||||
@@ -167,12 +167,12 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return Target.None;
|
||||
}
|
||||
|
||||
public override bool Cancel(Actor self, bool keepQueue = false)
|
||||
public override void Cancel(Actor self, bool keepQueue = false)
|
||||
{
|
||||
if (!IsCanceling && inner != null)
|
||||
inner.Cancel(self);
|
||||
|
||||
return base.Cancel(self);
|
||||
base.Cancel(self);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,12 +159,12 @@ namespace OpenRA.Mods.Common.Activities
|
||||
});
|
||||
}
|
||||
|
||||
public override bool Cancel(Actor self, bool keepQueue = false)
|
||||
public override void Cancel(Actor self, bool keepQueue = false)
|
||||
{
|
||||
if (!IsCanceling && innerActivity != null)
|
||||
innerActivity.Cancel(self);
|
||||
|
||||
return base.Cancel(self, keepQueue);
|
||||
base.Cancel(self, keepQueue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,17 +27,11 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
if (IsCanceling)
|
||||
return NextActivity;
|
||||
|
||||
return (remainingTicks-- == 0) ? NextActivity : this;
|
||||
}
|
||||
|
||||
public override bool Cancel(Actor self, bool keepQueue = false)
|
||||
{
|
||||
if (!base.Cancel(self, keepQueue))
|
||||
return false;
|
||||
|
||||
remainingTicks = 0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class WaitFor : Activity
|
||||
@@ -53,16 +47,10 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
if (IsCanceling)
|
||||
return NextActivity;
|
||||
|
||||
return (f == null || f()) ? NextActivity : this;
|
||||
}
|
||||
|
||||
public override bool Cancel(Actor self, bool keepQueue = false)
|
||||
{
|
||||
if (!base.Cancel(self, keepQueue))
|
||||
return false;
|
||||
|
||||
f = null;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,12 +41,12 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return this;
|
||||
}
|
||||
|
||||
public override bool Cancel(Actor self, bool keepQueue = false)
|
||||
public override void Cancel(Actor self, bool keepQueue = false)
|
||||
{
|
||||
if (!IsCanceling && inner != null)
|
||||
inner.Cancel(self);
|
||||
|
||||
return base.Cancel(self, keepQueue);
|
||||
base.Cancel(self, keepQueue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,11 +43,11 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
public override bool Cancel(Actor self, bool keepQueue = false)
|
||||
public override void Cancel(Actor self, bool keepQueue = false)
|
||||
{
|
||||
base.Cancel(self, keepQueue);
|
||||
Dispose();
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
@@ -51,8 +51,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
transform.Facing = facing.Facing;
|
||||
|
||||
transform.SkipMakeAnims = info.SkipMakeAnims;
|
||||
if (crusher.CancelActivity())
|
||||
crusher.QueueActivity(transform);
|
||||
crusher.CancelActivity();
|
||||
crusher.QueueActivity(transform);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user