diff --git a/CelesteTAS-EverestInterop/TAS/Input/Command.cs b/CelesteTAS-EverestInterop/TAS/Input/Command.cs index ae20de1df..649a3793e 100644 --- a/CelesteTAS-EverestInterop/TAS/Input/Command.cs +++ b/CelesteTAS-EverestInterop/TAS/Input/Command.cs @@ -14,11 +14,11 @@ namespace TAS.Input; #nullable enable [Flags] -public enum ExecuteTiming { +public enum ExecuteTiming : byte { /// Executes the command while parsing inputs, like Read commands - Parse, + Parse = 1 << 0, /// Executes the command at runtime while playing inputs, like Console commands - Runtime, + Runtime = 1 << 1, } /// Creates a command which can be used inside TAS files @@ -92,7 +92,7 @@ int Frame public static bool TryParse(InputController inputController, string filePath, int fileLine, string lineText, int frame, int studioLine, out Command command) { command = default; - if (!CommandLine.TryParse(lineText, out var commandLine)) { + if (string.IsNullOrWhiteSpace(lineText) || !char.IsLetter(lineText[0]) || !CommandLine.TryParse(lineText, out var commandLine)) { return false; } diff --git a/CelesteTAS-EverestInterop/Utils/Extensions.cs b/CelesteTAS-EverestInterop/Utils/Extensions.cs index 80fa30f7f..84129e1e2 100644 --- a/CelesteTAS-EverestInterop/Utils/Extensions.cs +++ b/CelesteTAS-EverestInterop/Utils/Extensions.cs @@ -400,9 +400,7 @@ public static T Apply(this T obj, Action action) { // https://github.com/NoelFB/Foster/blob/main/Framework/Extensions/EnumExt.cs internal static class EnumExtensions { - /// - /// Enum.Has boxes the value, where as this method does not. - /// + /// Enum.HasFlag boxes the value, whereas this method does not [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe bool Has(this TEnum lhs, TEnum rhs) where TEnum : unmanaged, Enum { return sizeof(TEnum) switch {