Skip to content
Closed
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
20 changes: 17 additions & 3 deletions Dependencies/Il2CppAssemblyGenerator/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ private static int Run()
if (!cpp2il.Execute())
{
cpp2il.Cleanup();
return 1;
return TryContinueWithExistingAssemblies();
}

if (!il2cppinterop.Execute())
{
cpp2il.Cleanup();
il2cppinterop.Cleanup();
return 1;
return TryContinueWithExistingAssemblies();
}

OldFiles_Cleanup();
Expand All @@ -133,6 +133,20 @@ private static int Run()
return 0;
}

private static int TryContinueWithExistingAssemblies()
{
if (LoaderConfig.Current.UnityEngine.ForceRegeneration)
return 1;

if (!Directory.Exists(MelonEnvironment.Il2CppAssembliesDirectory)
|| Directory.GetFiles(MelonEnvironment.Il2CppAssembliesDirectory, "*.dll").Length <= 0)
return 1;

Logger.Warning("Assembly Generation failed, but existing Il2Cpp assemblies were found.");
Logger.Warning("Continuing with the existing assemblies. Mods may be incompatible until generation succeeds.");
return 0;
}

private static void OldFiles_Cleanup()
{
if (Config.Values.OldFiles.Count <= 0)
Expand Down Expand Up @@ -169,4 +183,4 @@ private static void OldFiles_LAM()
Config.Save();
}
}
}
}