Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Celeste.Mod.mm/Mod/Everest/Everest.Relinker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public static class Relinker {
public static string GameChecksum => _GameChecksum = (_GameChecksum ?? Everest.GetChecksum(Assembly.GetAssembly(typeof(Relinker)).Location).ToHexadecimalString());
private static string _GameChecksum;

/// <summary>
/// Skips checking the GameChecksum when checking if mods should be relinked.
/// </summary>
internal static bool SkipGameChecksum;

/// <summary>
/// The lock which the relinker holds when relinking assemblies
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions Celeste.Mod.mm/Mod/Everest/Everest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ internal static void ParseArgs(string[] args) {
else if (arg == "--use-scancodes") {
Environment.SetEnvironmentVariable("FNA_KEYBOARD_USE_SCANCODES", "1");
}

else if (arg == "--no-game-checksum")
Relinker.SkipGameChecksum = true;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Celeste.Mod.mm/Mod/Module/EverestModuleAssemblyContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public static AsmChecksums ReadFromFile(string path) {
/// <returns>Whether this is compatible with <paramref name="other"/></returns>
public bool IsValidWith(AsmChecksums other) {
if (other == null) return false;
if (GameChecksum != other.GameChecksum) return false;
if (GameChecksum != other.GameChecksum && !Everest.Relinker.SkipGameChecksum) return false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe split the condition like this, so the current check remains identical after the change?

Suggested change
if (GameChecksum != other.GameChecksum && !Everest.Relinker.SkipGameChecksum) return false;
if (!Everest.Relinker.SkipGameChecksum)
if (GameChecksum != other.GameChecksum) return false;

if (FileChecksum != other.FileChecksum) return false;
if (SymFileChecksum != other.SymFileChecksum) return false;

Expand Down