Skip to content

Commit

Permalink
fix: Some TAS-commands not executing properly
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Sep 27, 2024
1 parent b39cba0 commit 1022554
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 4 additions & 4 deletions CelesteTAS-EverestInterop/TAS/Input/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down
4 changes: 1 addition & 3 deletions CelesteTAS-EverestInterop/Utils/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,7 @@ public static T Apply<T>(this T obj, Action<T> action) {

// https://github.com/NoelFB/Foster/blob/main/Framework/Extensions/EnumExt.cs
internal static class EnumExtensions {
/// <summary>
/// Enum.Has boxes the value, where as this method does not.
/// </summary>
/// Enum.HasFlag boxes the value, whereas this method does not
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe bool Has<TEnum>(this TEnum lhs, TEnum rhs) where TEnum : unmanaged, Enum {
return sizeof(TEnum) switch {
Expand Down

0 comments on commit 1022554

Please sign in to comment.