Clean up usage of CancelActivity.

This commit is contained in:
tovl
2019-08-31 16:47:12 +02:00
committed by reaperrr
parent 1e786b8e31
commit ac6431acf8
22 changed files with 24 additions and 83 deletions

View File

@@ -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;
}

View File

@@ -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);
}
}
}

View File

@@ -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();
}
}