Skip to content

Commit

Permalink
v1.2.1 ignores methods that are known to produce intermediate exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
pardeike committed Mar 8, 2023
1 parent cb0270a commit bcbb00f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Binary file modified 1.4/Assemblies/VisualExceptions.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion About/Manifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>net.pardeike.rimworld.mod.visualexceptions</identifier>
<version>1.2.0.0</version>
<version>1.2.1.0</version>
<targetVersions>
<li>1.2.0</li>
<li>1.3.0</li>
Expand Down
7 changes: 6 additions & 1 deletion Source/Patcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ static class Patcher
internal static bool patchesApplied = false;
internal static string harmony_id = "net.pardeike.rimworld.lib.harmony";

internal static HashSet<MethodBase> ignoredMethods = new HashSet<MethodBase>()
{
SymbolExtensions.GetMethodInfo(() => ParseHelper.FromString("", typeof(void)))
};

internal static void Apply()
{
var harmony = new Harmony(harmony_id);
Expand Down Expand Up @@ -138,7 +143,7 @@ internal static IEnumerable<MethodBase> TargetMethods()
var methods = typeof(Pawn).Assembly.GetTypes()
.Where(t => t.IsGenericType == false && (t.FullName.StartsWith("Verse.") || t.FullName.StartsWith("RimWorld.") || t.FullName.StartsWith("RuntimeAudioClipLoader.")))
.SelectMany(t => AccessTools.GetDeclaredMethods(t))
.Where(m => m.IsGenericMethod == false && HasCatch(m));
.Where(m => Patcher.ignoredMethods.Contains(m) == false && m.IsGenericMethod == false && HasCatch(m));
return methods;
}

Expand Down
6 changes: 3 additions & 3 deletions Source/VisualExceptions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<OutputPath>..\1.4\Assemblies\</OutputPath>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>1.2.0.0</Version>
<Version>1.2.1.0</Version>
<Copyright>Copyright Andreas Pardeike</Copyright>
</PropertyGroup>

Expand All @@ -31,13 +31,13 @@

<ItemGroup>
<PackageReference Include="Brrainz.RimWorld.CrossPromotion" Version="1.0.0" />
<PackageReference Include="Krafs.Rimworld.Ref" Version="1.4.3521-beta" GeneratePathProperty="true" />
<PackageReference Include="Krafs.Rimworld.Ref" Version="1.4.3641" GeneratePathProperty="true" />
<PackageReference Include="Lib.Harmony" Version="2.2.2">
<ExcludeAssets>runtime</ExcludeAssets>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.Platforms" Version="6.0.6" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="7.0.0" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down

0 comments on commit bcbb00f

Please sign in to comment.