diff --git a/YAMS-LIB/ExtensionMethods.cs b/YAMS-LIB/ExtensionMethods.cs index 5a98e87..d2a07aa 100644 --- a/YAMS-LIB/ExtensionMethods.cs +++ b/YAMS-LIB/ExtensionMethods.cs @@ -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)