Change to use pattern matching

This commit is contained in:
teinarss
2021-02-28 19:00:32 +01:00
committed by reaperrr
parent 7c0e4b25ae
commit d60c05eff3
35 changed files with 63 additions and 122 deletions

View File

@@ -36,8 +36,7 @@ namespace OpenRA.Mods.Common.Traits
// The DeployTransform order does not have a position associated with it,
// so we can only queue a new transformation if something else has
// already triggered the undeploy.
var currentTransform = self.CurrentActivity as Transform;
if (!order.Queued || currentTransform == null)
if (!order.Queued || !(self.CurrentActivity is Transform currentTransform))
return;
if (!order.Queued)