undo parallel loop (#716)

This caused errors during rewriting to be obfuscated with null reference exceptions.
This commit is contained in:
Jesse Plamondon-Willard 2020-06-02 22:05:00 -04:00
parent 6f4063cd86
commit 73e3735dcd
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
2 changed files with 6 additions and 6 deletions

View File

@ -6,7 +6,6 @@
* Mod warnings are now listed alphabetically.
* MacOS files starting with `._` are now ignored and can no longer cause skipped mods.
* Simplified paranoid warning logs and reduced their log level.
* Reduced startup time when loading mod DLLs (thanks to ZaneYork!).
* Fixed `BadImageFormatException` error detection.
* Fixed black maps on Android for mods which use `.tmx` files.

View File

@ -57,11 +57,12 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework
/// <returns>Returns whether the module was modified.</returns>
public bool RewriteModule()
{
return this.Module.GetTypes().AsParallel().WithExecutionMode(ParallelExecutionMode.ForceParallelism).Select(type =>
bool anyRewritten = false;
foreach (TypeDefinition type in this.Module.GetTypes())
{
bool anyRewritten = false;
if (type.BaseType == null)
return false; // special type like <Module>
continue; // special type like <Module>
anyRewritten |= this.RewriteCustomAttributes(type.CustomAttributes);
anyRewritten |= this.RewriteGenericParameters(type.GenericParameters);
@ -107,9 +108,9 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework
}
}
}
}
return anyRewritten;
}).Max();
return anyRewritten;
}