Fix IDE0055
This rule no longer appears to be buggy, so enforce it. Some of the automated fixes are adjusted in order to improve the result. #pragma directives have no option to control indentation, so remove them where possible.
This commit is contained in:
committed by
Pavel Penev
parent
60cbf79c9b
commit
360f24f609
@@ -1262,9 +1262,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
foreach (var cell in rallyPoint)
|
||||
self.QueueActivity(new AttackMoveActivity(self, () => aircraft.MoveTo(cell, 1, evaluateNearestMovableCell: true, targetLineColor: Color.OrangeRed)));
|
||||
}
|
||||
else
|
||||
if (self.World.Map.DistanceAboveTerrain(aircraft.CenterPosition).Length <= aircraft.LandAltitude.Length)
|
||||
QueueChild(new TakeOff(self));
|
||||
else if (self.World.Map.DistanceAboveTerrain(aircraft.CenterPosition).Length <= aircraft.LandAltitude.Length)
|
||||
QueueChild(new TakeOff(self));
|
||||
|
||||
aircraft.UnReserve();
|
||||
return true;
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
IsAiming = CanAimAtTarget(self, OpportunityTarget, opportunityForceAttack);
|
||||
|
||||
if (!IsAiming && Info.OpportunityFire && autoTarget != null &&
|
||||
!autoTarget.IsTraitDisabled && autoTarget.Stance >= UnitStance.Defend)
|
||||
!autoTarget.IsTraitDisabled && autoTarget.Stance >= UnitStance.Defend)
|
||||
{
|
||||
OpportunityTarget = autoTarget.ScanForTarget(self, false, false);
|
||||
opportunityForceAttack = false;
|
||||
@@ -265,7 +265,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
// The target may become hidden between the initial order request and the first tick (e.g. if queued)
|
||||
// Moving to any position (even if quite stale) is still better than immediately giving up
|
||||
if ((target.Type == TargetType.Actor && target.Actor.CanBeViewedByPlayer(self.Owner))
|
||||
|| target.Type == TargetType.FrozenActor || target.Type == TargetType.Terrain)
|
||||
|| target.Type == TargetType.FrozenActor || target.Type == TargetType.Terrain)
|
||||
{
|
||||
lastVisibleTarget = Target.FromPos(target.CenterPosition);
|
||||
lastVisibleMaximumRange = attack.GetMaximumRangeVersusTarget(target);
|
||||
|
||||
@@ -204,9 +204,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
var explored = self.Owner.Shroud.IsExplored(location);
|
||||
if (!self.World.Map.Contains(location) ||
|
||||
!(self.CurrentActivity is Transform || mobile.transforms.Any(t => !t.IsTraitDisabled && !t.IsTraitPaused))
|
||||
|| (!explored && !mobile.locomotor.Info.MoveIntoShroud)
|
||||
|| (explored && !CanEnterCell(self, location)))
|
||||
!(self.CurrentActivity is Transform || mobile.transforms.Any(t => !t.IsTraitDisabled && !t.IsTraitPaused))
|
||||
|| (!explored && !mobile.locomotor.Info.MoveIntoShroud)
|
||||
|| (explored && !CanEnterCell(self, location)))
|
||||
cursor = mobile.Info.BlockedCursor;
|
||||
else if (!explored || !mobile.Info.TerrainCursors.TryGetValue(self.World.Map.GetTerrainInfo(location).Type, out cursor))
|
||||
cursor = mobile.Info.Cursor;
|
||||
|
||||
@@ -409,7 +409,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
void INotifyKilled.Killed(Actor self, AttackInfo e)
|
||||
{
|
||||
{
|
||||
// IsAtGroundLevel contains Map.Contains(self.Location) check.
|
||||
if (Info.EjectOnDeath && self.IsAtGroundLevel() && (!checkTerrainType || Info.UnloadTerrainTypes.Contains(self.World.Map.GetTerrainInfo(self.Location).Type)))
|
||||
{
|
||||
|
||||
@@ -217,8 +217,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
chargedToken = self.RevokeCondition(chargedToken);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (chargedToken == Actor.InvalidConditionToken)
|
||||
chargedToken = self.GrantCondition(Info.ChargedCondition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
// TODO: This won't make sense for MP saves
|
||||
var localPlayer = worldRenderer.World.LocalPlayer;
|
||||
if ((localPlayer != null && localPlayer.PlayerActor != self) ||
|
||||
(localPlayer == null && self.Owner != self.World.Players.FirstOrDefault(p => p.IsBot)))
|
||||
(localPlayer == null && self.Owner != self.World.Players.FirstOrDefault(p => p.IsBot)))
|
||||
return null;
|
||||
|
||||
var nodes = new List<MiniYamlNode>()
|
||||
|
||||
Reference in New Issue
Block a user