Clean up usage of CancelActivity.
This commit is contained in:
@@ -80,8 +80,6 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
// Return to original location
|
||||
if (--ReturnTicks == 0)
|
||||
{
|
||||
self.CancelActivity();
|
||||
|
||||
// The Move activity is not immediately cancelled, which, combined
|
||||
// with Activity.Cancel discarding NextActivity without checking the
|
||||
// IsInterruptable flag, means that a well timed order can cancel the
|
||||
@@ -95,7 +93,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
typeof(Actor).GetProperty("CurrentActivity").SetValue(self, null);
|
||||
|
||||
// The actor is killed using Info.DamageTypes if the teleport fails
|
||||
self.QueueActivity(new Teleport(chronosphere, Origin, null, true, killCargo, Info.ChronoshiftSound,
|
||||
self.QueueActivity(false, new Teleport(chronosphere, Origin, null, true, killCargo, Info.ChronoshiftSound,
|
||||
false, true, Info.DamageTypes));
|
||||
}
|
||||
}
|
||||
@@ -144,8 +142,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
this.killCargo = killCargo;
|
||||
|
||||
// Set up the teleport
|
||||
self.CancelActivity();
|
||||
self.QueueActivity(new Teleport(chronosphere, targetLocation, null, killCargo, true, Info.ChronoshiftSound));
|
||||
self.QueueActivity(false, new Teleport(chronosphere, targetLocation, null, killCargo, true, Info.ChronoshiftSound));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -61,8 +61,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
if (facing != null)
|
||||
transform.Facing = facing.Facing;
|
||||
|
||||
self.CancelActivity();
|
||||
self.QueueActivity(transform);
|
||||
self.QueueActivity(false, transform);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,10 +114,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
if (!CanInfiltrateTarget(self, order.Target))
|
||||
return;
|
||||
|
||||
if (!order.Queued)
|
||||
self.CancelActivity();
|
||||
|
||||
self.QueueActivity(new Infiltrate(self, order.Target, this));
|
||||
self.QueueActivity(order.Queued, new Infiltrate(self, order.Target, this));
|
||||
self.ShowTargetLines();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user