Fix RCS1246
This commit is contained in:
@@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Orders
|
||||
|
||||
// HACK: This is required by the hacky player actions-per-minute calculation
|
||||
// TODO: Reimplement APM properly and then remove this
|
||||
yield return new Order("CreateGroup", actorsInvolved.First().Owner.PlayerActor, false, actorsInvolved);
|
||||
yield return new Order("CreateGroup", actorsInvolved[0].Owner.PlayerActor, false, actorsInvolved);
|
||||
|
||||
foreach (var o in orders)
|
||||
yield return CheckSameOrder(o.Order, o.Trait.IssueOrder(o.Actor, o.Order, o.Target, mi.Modifiers.HasModifier(Modifiers.Shift)));
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace OpenRA.Mods.Common.Terrain
|
||||
if (onMissingImage != null && variants.Count == 0)
|
||||
continue;
|
||||
|
||||
templates.Add(t.Value.Id, new TheaterTemplate(allSprites.ToArray(), variants.First().Length, templateInfo.Images.Length));
|
||||
templates.Add(t.Value.Id, new TheaterTemplate(allSprites.ToArray(), variants[0].Length, templateInfo.Images.Length));
|
||||
}
|
||||
|
||||
// 1x1px transparent tile
|
||||
|
||||
@@ -226,7 +226,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
var vec = new CVec(Info.MineFieldRadius, Info.MineFieldRadius);
|
||||
bot.QueueOrder(new Order("PlaceMinefield", null, Target.FromCell(world, minelayingPosition + vec), false, groupedActors: orderedActors.ToArray()) { ExtraLocation = minelayingPosition - vec });
|
||||
bot.QueueOrder(new Order("Move", null, Target.FromCell(world, orderedActors.First().Location), true, groupedActors: orderedActors.ToArray()));
|
||||
bot.QueueOrder(new Order("Move", null, Target.FromCell(world, orderedActors[0].Location), true, groupedActors: orderedActors.ToArray()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -428,7 +428,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
var allEnemyBaseBuilder = FindEnemies(
|
||||
World.Actors.Where(a => Info.ConstructionYardTypes.Contains(a.Info.Name)),
|
||||
ownUnits.First())
|
||||
ownUnits[0])
|
||||
.ToList();
|
||||
|
||||
if (allEnemyBaseBuilder.Count == 0 || ownUnits.Count < Info.SquadSize)
|
||||
@@ -443,7 +443,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
unit.Info.HasTraitInfo<AttackBaseInfo>()
|
||||
&& !Info.AirUnitsTypes.Contains(unit.Info.Name)
|
||||
&& !Info.NavalUnitsTypes.Contains(unit.Info.Name)),
|
||||
ownUnits.First())
|
||||
ownUnits[0])
|
||||
.ToList();
|
||||
|
||||
if (AttackOrFleeFuzzy.Rush.CanAttack(ownUnits, enemies.ConvertAll(x => x.Actor)))
|
||||
|
||||
@@ -293,7 +293,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
if (mi.Button == Game.Settings.Game.MouseButtonPreference.Action)
|
||||
{
|
||||
minelayers.First().World.CancelInputMode();
|
||||
minelayers[0].World.CancelInputMode();
|
||||
foreach (var minelayer in minelayers)
|
||||
yield return new Order("PlaceMinefield", minelayer, Target.FromCell(world, cell), queued) { ExtraLocation = minefieldStart };
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Graphics;
|
||||
using OpenRA.Traits;
|
||||
@@ -48,7 +47,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
yield break;
|
||||
|
||||
var anim = new Animation(init.World, image);
|
||||
anim.PlayFetchIndex(RenderSprites.NormalizeSequence(anim, init.GetDamageState(), Sequences.First()), () => 0);
|
||||
anim.PlayFetchIndex(RenderSprites.NormalizeSequence(anim, init.GetDamageState(), Sequences[0]), () => 0);
|
||||
|
||||
yield return new SpriteActorPreview(anim, () => WVec.Zero, () => 0, p);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Graphics;
|
||||
using OpenRA.Traits;
|
||||
@@ -56,7 +55,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
yield break;
|
||||
|
||||
var anim = new Animation(init.World, image, init.GetFacing());
|
||||
anim.PlayRepeating(RenderSprites.NormalizeSequence(anim, init.GetDamageState(), StandSequences.First()));
|
||||
anim.PlayRepeating(RenderSprites.NormalizeSequence(anim, init.GetDamageState(), StandSequences[0]));
|
||||
|
||||
if (IsPlayerPalette)
|
||||
p = init.WorldRenderer.Palette(Palette + init.Get<OwnerInit>().InternalName);
|
||||
|
||||
@@ -197,7 +197,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (!Active)
|
||||
return;
|
||||
|
||||
var power = Instances.First();
|
||||
var power = Instances[0];
|
||||
if (Manager.DevMode.FastCharge && remainingSubTicks > 2500)
|
||||
remainingSubTicks = 2500;
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic.Ingame
|
||||
.Skip(1)
|
||||
.FirstOrDefault();
|
||||
|
||||
next ??= bases.First();
|
||||
next ??= bases[0];
|
||||
|
||||
selection.Combine(world, new Actor[] { next }, false, true);
|
||||
viewport.Center(selection.Actors);
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic.Ingame
|
||||
.Skip(1)
|
||||
.FirstOrDefault();
|
||||
|
||||
next ??= harvesters.First();
|
||||
next ??= harvesters[0];
|
||||
|
||||
selection.Combine(world, new Actor[] { next }, false, true);
|
||||
viewport.Center(selection.Actors);
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic.Ingame
|
||||
var facilities = world.ActorsHavingTrait<Production>()
|
||||
.Where(a => a.Owner == player && a.OccupiesSpace != null && !a.Info.HasTraitInfo<BaseBuildingInfo>()
|
||||
&& a.TraitsImplementing<Production>().Any(t => !t.IsTraitDisabled))
|
||||
.OrderBy(f => f.TraitsImplementing<Production>().First(t => !t.IsTraitDisabled).Info.Produces.First())
|
||||
.OrderBy(f => f.TraitsImplementing<Production>().First(t => !t.IsTraitDisabled).Info.Produces[0])
|
||||
.ToList();
|
||||
|
||||
if (facilities.Count == 0)
|
||||
@@ -58,7 +58,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic.Ingame
|
||||
.Skip(1)
|
||||
.FirstOrDefault();
|
||||
|
||||
next ??= facilities.First();
|
||||
next ??= facilities[0];
|
||||
|
||||
Game.Sound.PlayNotification(world.Map.Rules, null, "Sounds", clickSound, null);
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
missionList.ScrollToSelectedItem();
|
||||
}
|
||||
else
|
||||
SelectMap(allPreviews.First());
|
||||
SelectMap(allPreviews[0]);
|
||||
}
|
||||
|
||||
// Preload map preview to reduce jank
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
videoVolumeSlider.OnChange += x => Game.Sound.VideoVolume = x;
|
||||
|
||||
var devices = Game.Sound.AvailableDevices();
|
||||
soundDevice = Array.Find(devices, d => d.Device == ss.Device) ?? devices.First();
|
||||
soundDevice = Array.Find(devices, d => d.Device == ss.Device) ?? devices[0];
|
||||
|
||||
var audioDeviceDropdown = panel.Get<DropDownButtonWidget>("AUDIO_DEVICE");
|
||||
audioDeviceDropdown.OnMouseDown = _ => ShowAudioDeviceDropdown(audioDeviceDropdown, devices, scrollPanel);
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
.ThenBy(q => q.RemainingTimeActual)
|
||||
.ToList();
|
||||
|
||||
var current = queued.First();
|
||||
var current = queued[0];
|
||||
var queue = current.Queue;
|
||||
|
||||
var faction = queue.Actor.Owner.Faction.InternalName;
|
||||
@@ -195,7 +195,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
var bold = Game.Renderer.Fonts["Small"];
|
||||
foreach (var icon in productionIcons)
|
||||
{
|
||||
var current = icon.Queued.First();
|
||||
var current = icon.Queued[0];
|
||||
var text = GetOverlayForItem(current, world.Timestep);
|
||||
tiny.DrawTextWithContrast(text,
|
||||
icon.Pos + new float2(16, 12) - new float2(tiny.Measure(text).X / 2, 0),
|
||||
|
||||
Reference in New Issue
Block a user