Skip to content
Merged
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
15 changes: 10 additions & 5 deletions StarMap.Core/Patches/PatchManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ public static bool PrefixPatchEntryPoint<T>(
MethodBase __originalMethod,
object[] __args,
object? __instance,
ref T __result)
ref object? __result)
{
object? result = __result;
var result = __result;
var outcome = _instance?.PatchEntryPoint(HarmonyPatchType.Prefix, __originalMethod, __args, __instance, ref result) ?? true;
__result = IPatchCallback.CastValue<T>(result, nameof(__result));
return outcome;
Expand All @@ -154,9 +154,9 @@ public static void PostfixPatchEntryPoint<T>(
MethodBase __originalMethod,
object[] __args,
object? __instance,
ref T __result)
ref object? __result)
{
object? result = __result;
var result = __result;
_instance?.PatchEntryPoint(HarmonyPatchType.Postfix, __originalMethod, __args, __instance, ref result);
__result = IPatchCallback.CastValue<T>(result, nameof(__result));
}
Expand Down Expand Up @@ -454,7 +454,12 @@ public void Dispose()
if (Interlocked.Exchange(ref _disposed, 1) != 0)
return;

_patch.UnregisterPatch(this);
try
{
_patch.UnregisterPatch(this);
}
catch { }

}
}
}
Expand Down
8 changes: 8 additions & 0 deletions StarMap/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"StarMap": {
"commandName": "Project",
"commandLineArgs": "-InstancePath \"C:\\Users\\klaas\\AppData\\Local\\Borea\\Instances\\6cc3f568-20c3-4592-9df6-faaf6448ea8e\""
}
}
}
Loading