Skip to content

Commit

Permalink
Address @Miepee suggestions.
Browse files Browse the repository at this point in the history
  • Loading branch information
VladiStep committed Dec 30, 2023
1 parent e3c8837 commit b7f6a89
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 2 additions & 0 deletions UndertaleModLib/Decompiler/Decompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3986,6 +3986,8 @@ public static void BuildSubFunctionCache(UndertaleData data)
data.KnownSubFunctions = new Dictionary<string, UndertaleFunction>();
GlobalDecompileContext globalDecompileContext = new GlobalDecompileContext(data, false);

// TODO: Is this necessary?
// Doesn't the latter `Parallel.ForEach()` already cover this?
foreach (var func in data.Functions)
{
if (func.Name.Content.StartsWith("gml_Script_"))
Expand Down
17 changes: 7 additions & 10 deletions UndertaleModTool/Editors/UndertaleCodeEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -714,16 +714,13 @@ private async Task DecompileCode(UndertaleCode code, bool first, LoaderDialog ex
for (int i = 0; i < matches.Length; i++)
{
Match match = matches[i];
if (match.Success)
{
if (currDict.TryGetValue(match.Groups[1].Value, out string text))
{
if (i != matches.Length - 1) // if not the last
decompLinesBuilder.Append($"{text}; ");
else
decompLinesBuilder.Append(text + '\n');
}
}
if (!currDict.TryGetValue(match.Groups[1].Value, out string text))
continue;

if (i != matches.Length - 1) // If not the last
decompLinesBuilder.Append($"{text}; ");
else
decompLinesBuilder.Append(text + '\n');
}
}
else
Expand Down

0 comments on commit b7f6a89

Please sign in to comment.