Fix RCS1246

This commit is contained in:
RoosterDragon
2023-03-18 13:25:59 +00:00
committed by Gustas
parent 330ca92045
commit acca837142
21 changed files with 32 additions and 32 deletions

View File

@@ -423,7 +423,7 @@ namespace OpenRA
// Sanitize input from platform-specific launchers
// Process.Start requires paths to not be quoted, even if they contain spaces
if (launchPath != null && launchPath.First() == '"' && launchPath.Last() == '"')
if (launchPath != null && launchPath[0] == '"' && launchPath.Last() == '"')
launchPath = launchPath[1..^1];
// Metadata registration requires an explicit launch path

View File

@@ -1197,7 +1197,7 @@ namespace OpenRA
// Project this guessed cell and take the first available cell
// If it is projected outside the layer, then make another guess.
var allProjected = ProjectedCellsCovering(uv);
var projected = allProjected.Length > 0 ? allProjected.First()
var projected = allProjected.Length > 0 ? allProjected[0]
: new PPos(uv.U, uv.V.Clamp(Bounds.Top, Bounds.Bottom));
// Clamp the projected cell to the map area
@@ -1266,7 +1266,7 @@ namespace OpenRA
PPos edge;
if (allProjected.Length > 0)
{
var puv = allProjected.First();
var puv = allProjected[0];
var horizontalBound = (puv.U - Bounds.Left < Bounds.Width / 2) ? Bounds.Left : Bounds.Right;
var verticalBound = (puv.V - Bounds.Top < Bounds.Height / 2) ? Bounds.Top : Bounds.Bottom;

View File

@@ -102,7 +102,7 @@ namespace OpenRA.Scripting
if (names.Length != 1)
throw new InvalidOperationException($"[ScriptGlobal] attribute not found for global table '{type}'");
Name = names.First().Name;
Name = names[0].Name;
Bind(new[] { this });
}
@@ -114,7 +114,7 @@ namespace OpenRA.Scripting
{
using (var luaObject = a.ToLuaValue(Context))
using (var filterResult = filter.Call(luaObject))
using (var result = filterResult.First())
using (var result = filterResult[0])
return result.ToBoolean();
});
}
@@ -214,7 +214,7 @@ namespace OpenRA.Scripting
var ctor = Array.Find(b.GetConstructors(BindingFlags.Public | BindingFlags.Instance), c =>
{
var p = c.GetParameters();
return p.Length == 1 && p.First().ParameterType == typeof(ScriptContext);
return p.Length == 1 && p[0].ParameterType == typeof(ScriptContext);
});
if (ctor == null)

View File

@@ -68,7 +68,7 @@ namespace OpenRA.Server
ticksPerInterval = Interval / timestep;
this.players = players.ToList();
baselinePlayer = this.players.First();
baselinePlayer = this.players[0];
foreach (var player in this.players)
{
@@ -128,7 +128,7 @@ namespace OpenRA.Server
players.Remove(player);
if (player == baselinePlayer && players.Count > 0)
{
var newBaseline = players.First();
var newBaseline = players[0];
Interlocked.Exchange(ref baselinePlayer, newBaseline);
}