Skip to content

Commit

Permalink
change debug return value back
Browse files Browse the repository at this point in the history
  • Loading branch information
Miepee committed Jun 14, 2024
1 parent 9aa7795 commit c4d572d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions YAMS-LIB/ExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,18 @@ public static string GetGMLCode(this UndertaleCode code)
return Decompiler.Decompile(code, decompileContext);
}

public static bool ReplaceGMLInCode(this UndertaleCode code, string textToReplace, string replacementText, bool ignoreErrors = false)
public static void ReplaceGMLInCode(this UndertaleCode code, string textToReplace, string replacementText, bool ignoreErrors = false)
{
var codeText = Decompiler.Decompile(code, decompileContext);
if (!codeText.Contains(textToReplace))
{
if (ignoreErrors)
return false;
return;

throw new ApplicationException($"The text \"{textToReplace}\" was not found in \"{code.Name.Content}\"!");
}
codeText = codeText.Replace(textToReplace, replacementText);
code.ReplaceGML(codeText, gmData);
return true;
}

public static void PrependGMLInCode(this UndertaleCode code, string prependedText)
Expand Down

0 comments on commit c4d572d

Please sign in to comment.