add self param to OnCancel
This commit is contained in:
@@ -186,11 +186,11 @@ namespace OpenRA.Traits
|
|||||||
protected bool IsCanceled { get; private set; }
|
protected bool IsCanceled { get; private set; }
|
||||||
|
|
||||||
public abstract IActivity Tick( Actor self );
|
public abstract IActivity Tick( Actor self );
|
||||||
protected virtual bool OnCancel() { return true; }
|
protected virtual bool OnCancel( Actor self ) { return true; }
|
||||||
|
|
||||||
public void Cancel( Actor self )
|
public void Cancel( Actor self )
|
||||||
{
|
{
|
||||||
IsCanceled = OnCancel();
|
IsCanceled = OnCancel( self );
|
||||||
if( IsCanceled )
|
if( IsCanceled )
|
||||||
NextActivity = null;
|
NextActivity = null;
|
||||||
else if (NextActivity != null)
|
else if (NextActivity != null)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnCancel()
|
protected override bool OnCancel( Actor self )
|
||||||
{
|
{
|
||||||
return Interruptible;
|
return Interruptible;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnCancel()
|
protected override bool OnCancel( Actor self )
|
||||||
{
|
{
|
||||||
active = false;
|
active = false;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnCancel()
|
protected override bool OnCancel( Actor self )
|
||||||
{
|
{
|
||||||
if( !interruptable ) return false;
|
if( !interruptable ) return false;
|
||||||
remainingTicks = 0;
|
remainingTicks = 0;
|
||||||
|
|||||||
@@ -52,6 +52,6 @@ namespace OpenRA.Mods.RA
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnCancel() { return false; }
|
protected override bool OnCancel( Actor self ) { return false; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ namespace OpenRA.Mods.RA.Move
|
|||||||
return nextCell;
|
return nextCell;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnCancel()
|
protected override bool OnCancel( Actor self )
|
||||||
{
|
{
|
||||||
path = new List<int2>();
|
path = new List<int2>();
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user