Fix RCS1077
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Eluant;
|
||||
using OpenRA.Mods.Cnc.Activities;
|
||||
@@ -32,7 +33,7 @@ namespace OpenRA.Mods.Cnc.Scripting
|
||||
[Desc("Infiltrate the target actor.")]
|
||||
public void Infiltrate(Actor target)
|
||||
{
|
||||
var infiltrates = infiltratesTraits.FirstOrDefault(x => !x.IsTraitDisabled && x.Info.Types.Overlaps(target.GetEnabledTargetTypes()));
|
||||
var infiltrates = Array.Find(infiltratesTraits, x => !x.IsTraitDisabled && x.Info.Types.Overlaps(target.GetEnabledTargetTypes()));
|
||||
|
||||
if (infiltrates == null)
|
||||
throw new LuaException($"{Self} tried to infiltrate invalid target {target}!");
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
if (!available || order.ExtraData != 1)
|
||||
return;
|
||||
|
||||
var power = Instances.FirstOrDefault(i => !i.IsTraitPaused);
|
||||
var power = Instances.Find(i => !i.IsTraitPaused);
|
||||
if (power == null)
|
||||
return;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
|
||||
var inputFiles = GlobArgs(args).OrderBy(a => a).ToList();
|
||||
var dest = inputFiles[0].Split('-').First() + ".shp";
|
||||
|
||||
var frames = inputFiles.Select(a => new Png(File.OpenRead(a))).ToList();
|
||||
var frames = inputFiles.ConvertAll(a => new Png(File.OpenRead(a)));
|
||||
if (frames.Any(f => f.Type != SpriteFrameType.Indexed8))
|
||||
throw new InvalidOperationException("All frames must be paletted");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user