mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
fix intro cutscene bug
This commit is contained in:
1 parent
6f4eff7b38
commit
9e2787b781
1 file changed
+10
-4
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user