fix intro cutscene bug

This commit is contained in:
XtraCube committed 2025-02-27 20:19:34 -05:00
1 parent 6f4eff7b38
commit 9e2787b781
1 file changed
+10 -4
+10 -4
View File
@@ -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<PlayerControl> yourTeam)
public static bool BeginPrefix(IntroCutscene __instance, [HarmonyArgument(0)] ref Il2CppSystem.Collections.Generic.List<PlayerControl> 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);
}
/*