Fix IDE0083
This commit is contained in:
committed by
Pavel Penev
parent
bd2b3d9793
commit
164abfdae1
@@ -413,7 +413,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
// Add takeoff activity if Aircraft trait is not paused and the actor should not land when idle.
|
||||
if (ForceLanding && !IsTraitPaused && !cruising && !(self.CurrentActivity is TakeOff))
|
||||
if (ForceLanding && !IsTraitPaused && !cruising && self.CurrentActivity is not TakeOff)
|
||||
{
|
||||
ForceLanding = false;
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (!h.Key.IsIdle)
|
||||
{
|
||||
// Ignore this actor if FindAndDeliverResources is working fine or it is performing a different activity
|
||||
if (!(h.Key.CurrentActivity is FindAndDeliverResources act) || !act.LastSearchFailed)
|
||||
if (h.Key.CurrentActivity is not FindAndDeliverResources act || !act.LastSearchFailed)
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +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.
|
||||
if (!order.Queued || !(self.CurrentActivity is Transform currentTransform))
|
||||
if (!order.Queued || self.CurrentActivity is not Transform currentTransform)
|
||||
return;
|
||||
|
||||
currentTransform.Queue(new IssueOrderAfterTransform("DeployTransform", order.Target));
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public override void RulesetLoaded(Ruleset rules, ActorInfo ai)
|
||||
{
|
||||
var mobileInfo = ai.TraitInfoOrDefault<MobileInfo>();
|
||||
if (mobileInfo == null || !(mobileInfo.LocomotorInfo is SubterraneanLocomotorInfo))
|
||||
if (mobileInfo == null || mobileInfo.LocomotorInfo is not SubterraneanLocomotorInfo)
|
||||
throw new YamlException("GrantConditionOnSubterraneanLayer requires Mobile to be linked to a SubterraneanLocomotor!");
|
||||
|
||||
base.RulesetLoaded(rules, ai);
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
protected override IEnumerable<IRenderable> RenderSelectionBars(Actor self, WorldRenderer wr, bool displayHealth, bool displayExtra)
|
||||
{
|
||||
// Don't render the selection bars for non-selectable actors
|
||||
if (!(interactable is Selectable) || (!displayHealth && !displayExtra))
|
||||
if (interactable is not Selectable || (!displayHealth && !displayExtra))
|
||||
yield break;
|
||||
|
||||
var bounds = interactable.DecorationBounds(self, wr);
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
if (exitingActor == null)
|
||||
return;
|
||||
|
||||
if (!exitingActor.IsInWorld || exitingActor.Location != openExit || !(exitingActor.CurrentActivity is Mobile.ReturnToCellActivity))
|
||||
if (!exitingActor.IsInWorld || exitingActor.Location != openExit || exitingActor.CurrentActivity is not Mobile.ReturnToCellActivity)
|
||||
{
|
||||
desiredFrame = 0;
|
||||
exitingActor = null;
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
IEnumerable<IRenderable> ITiledTerrainRenderer.RenderUIPreview(WorldRenderer wr, TerrainTemplateInfo t, int2 origin, float scale)
|
||||
{
|
||||
if (!(t is DefaultTerrainTemplateInfo template))
|
||||
if (t is not DefaultTerrainTemplateInfo template)
|
||||
yield break;
|
||||
|
||||
var ts = map.Grid.TileSize;
|
||||
@@ -187,7 +187,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
IEnumerable<IRenderable> ITiledTerrainRenderer.RenderPreview(WorldRenderer wr, TerrainTemplateInfo t, WPos origin)
|
||||
{
|
||||
if (!(t is DefaultTerrainTemplateInfo template))
|
||||
if (t is not DefaultTerrainTemplateInfo template)
|
||||
yield break;
|
||||
|
||||
var i = 0;
|
||||
|
||||
Reference in New Issue
Block a user