Skip to content

Commit

Permalink
Increase summary errors when compiling fails from 2 to 5, also simpli…
Browse files Browse the repository at this point in the history
…fy the informational text at the end a bit (Thanks Goodly)
  • Loading branch information
UnknownShadow200 committed Mar 24, 2023
1 parent 8dde70e commit ddf1dae
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions MCGalaxy/Modules/Compiling/CompilerOperations.cs
Expand Up @@ -66,8 +66,6 @@ public static class CompilerOperations
return true;
}


const int MAX_LOG = 2;

/// <summary> Attempts to compile the given source code files into a .dll </summary>
/// <param name="p"> Player to send messages to </param>
Expand Down Expand Up @@ -95,6 +93,7 @@ public static class CompilerOperations
return false;
}

const int MAX_LOG = 5;
static void SummariseErrors(ICompilerErrors errors, string[] srcs, Player p) {
int logged = 0;
foreach (ICompilerError err in errors)
Expand All @@ -105,10 +104,10 @@ public static class CompilerOperations
if (logged >= MAX_LOG) break;
}

if (errors.Count > MAX_LOG) {
p.Message(" &W.. and {0} more", errors.Count - MAX_LOG);
if (logged < errors.Count) {
p.Message(" &W.. and {0} more", errors.Count - logged);
}
p.Message("&WCompilation error. See " + ICompiler.ERROR_LOG_PATH + " for more information.");
p.Message("&WCompiling failed. See " + ICompiler.ERROR_LOG_PATH + " for more detail");
}
}
}
Expand Down

0 comments on commit ddf1dae

Please sign in to comment.