Fix CA1851
This commit is contained in:
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.D2k.Activities
|
||||
swallow = self.Trait<AttackSwallow>();
|
||||
}
|
||||
|
||||
bool AttackTargets(Actor self, IEnumerable<Actor> targets)
|
||||
bool AttackTargets(Actor self, IReadOnlyCollection<Actor> targets)
|
||||
{
|
||||
var targetLocation = target.Actor.Location;
|
||||
foreach (var t in targets)
|
||||
@@ -129,9 +129,10 @@ namespace OpenRA.Mods.D2k.Activities
|
||||
}
|
||||
|
||||
var targets = self.World.ActorMap.GetActorsAt(targetLocation)
|
||||
.Where(t => !t.Equals(self) && weapon.IsValidAgainst(t, self));
|
||||
.Where(t => !t.Equals(self) && weapon.IsValidAgainst(t, self))
|
||||
.ToList();
|
||||
|
||||
if (!targets.Any())
|
||||
if (targets.Count == 0)
|
||||
{
|
||||
RevokeCondition(self);
|
||||
return true;
|
||||
|
||||
@@ -509,17 +509,12 @@ namespace OpenRA.Mods.D2k.UtilityCommands
|
||||
|
||||
// HACK: The arrakis.yaml tileset file seems to be missing some tiles, so just get a replacement for them
|
||||
// Also used for duplicate tiles that are taken from only tileset
|
||||
if (template == null)
|
||||
// Just get a template that contains a tile with the same ID as requested
|
||||
template ??= terrainInfo.Templates.FirstOrDefault(t =>
|
||||
{
|
||||
// Just get a template that contains a tile with the same ID as requested
|
||||
var templates = terrainInfo.Templates.Where(t =>
|
||||
{
|
||||
var templateInfo = (DefaultTerrainTemplateInfo)t.Value;
|
||||
return templateInfo.Frames != null && templateInfo.Frames.Contains(tileIndex);
|
||||
});
|
||||
if (templates.Any())
|
||||
template = templates.First().Value;
|
||||
}
|
||||
var templateInfo = (DefaultTerrainTemplateInfo)t.Value;
|
||||
return templateInfo.Frames != null && templateInfo.Frames.Contains(tileIndex);
|
||||
}).Value;
|
||||
|
||||
if (template == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user