From 1022554933b8e5730fd231972e9b0c19118ed130 Mon Sep 17 00:00:00 2001 From: psyGamer Date: Fri, 27 Sep 2024 22:43:55 +0200 Subject: [PATCH] fix: Some TAS-commands not executing properly --- CelesteTAS-EverestInterop/TAS/Input/Command.cs | 8 ++++---- CelesteTAS-EverestInterop/Utils/Extensions.cs | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CelesteTAS-EverestInterop/TAS/Input/Command.cs b/CelesteTAS-EverestInterop/TAS/Input/Command.cs index ae20de1d..649a3793 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 80fa30f7..84129e1e 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 {