mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
Fix minigame crashes
This commit is contained in:
1 parent
e57e88c179
commit
7a7204b0e0
1 file changed
+10
-3
@@ -2,11 +2,18 @@
|
||||
|
||||
namespace MiraAPI.Patches;
|
||||
|
||||
[HarmonyPatch(typeof(Minigame), nameof(Minigame.Begin))]
|
||||
internal static class MinigameBeginErrorPatch
|
||||
/// <summary>
|
||||
/// Used to fix the Minigame crash errors (credits Submerged/PH Gaming for the fix)
|
||||
/// </summary>
|
||||
[HarmonyPatch]
|
||||
public static class MinigameBeginErrorPatch
|
||||
{
|
||||
private static readonly Logger _logger = new(Logger.Category.Gameplay, "Minigame");
|
||||
|
||||
[HarmonyPatch(typeof(Minigame), nameof(Minigame.Begin))]
|
||||
[HarmonyPrefix]
|
||||
public static void Prefix(Minigame __instance)
|
||||
{
|
||||
__instance.logger ??= new Logger(Logger.Category.Gameplay, "Minigame");
|
||||
__instance.logger ??= _logger;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user