diff --git a/MiraAPI/Patches/IntroCutscenePatches.cs b/MiraAPI/Patches/IntroCutscenePatches.cs index 415e9d6..df15627 100644 --- a/MiraAPI/Patches/IntroCutscenePatches.cs +++ b/MiraAPI/Patches/IntroCutscenePatches.cs @@ -33,11 +33,19 @@ public static class IntroCutscenePatches [HarmonyPrefix] [HarmonyPatch(nameof(IntroCutscene.BeginImpostor))] [HarmonyPatch(nameof(IntroCutscene.BeginCrewmate))] - public static bool BeginImpostorPatch(IntroCutscene __instance, [HarmonyArgument(0)] ref Il2CppSystem.Collections.Generic.List yourTeam) + public static bool BeginPrefix(IntroCutscene __instance, [HarmonyArgument(0)] ref Il2CppSystem.Collections.Generic.List yourTeam) + { + return PlayerControl.LocalPlayer.Data.Role is not ICustomRole customRole || customRole.SetupIntroTeam(__instance, ref yourTeam); + } + + [HarmonyPostfix] + [HarmonyPatch(nameof(IntroCutscene.BeginImpostor))] + [HarmonyPatch(nameof(IntroCutscene.BeginCrewmate))] + public static void BeginPostfix(IntroCutscene __instance) { if (PlayerControl.LocalPlayer.Data.Role is not ICustomRole customRole) { - return true; + return; } if (customRole.IntroConfiguration is { } introConfig) @@ -47,8 +55,6 @@ public static class IntroCutscenePatches __instance.TeamTitle.text = introConfig.IntroTeamTitle; __instance.ImpostorText.text = introConfig.IntroTeamDescription; } - - return customRole.SetupIntroTeam(__instance, ref yourTeam); } /*