Fix initialize patch for gamemodes

This commit is contained in:
Atony committed 2026-08-12 22:25:56 -05:00
1 parent 877fc15aec
commit 4c38189444
2 files changed
+10 -2

No files matched your search

+5 -2
View File
@@ -243,9 +243,7 @@ public class HideAndSeekMode : AbstractGameMode
public override IEnumerator IntroCutscene(IntroCutscene __instance)
{
deadPlayerCount = 0;
SoundManager.Instance.PlaySound(__instance.IntroStinger, false, 1f, null);
ShipStatus.Instance.BreakEmergencyButton();
Logger.GlobalInstance.Info("IntroCutscene :: CoBegin() :: Game Mode: Hide and Seek (MiraAPI)", null);
__instance.LogPlayerRoleData();
__instance.HideAndSeekPanels.SetActive(true);
@@ -393,6 +391,11 @@ public class HideAndSeekMode : AbstractGameMode
ShipStatus.Instance.StartSFX();
UnityEngine.Object.Destroy(__instance.gameObject);
}
public override void Initialize()
{
deadPlayerCount = 0;
ShipStatus.Instance.BreakEmergencyButton();
}
public override PlayerBodyTypes GetBodyType(PlayerControl player)
{
+5
View File
@@ -3,6 +3,7 @@ using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes;
using MiraAPI.Events;
using MiraAPI.Events.Vanilla.Gameplay;
using MiraAPI.GameModes;
using MiraAPI.Roles;
using MiraAPI.Utilities;
@@ -122,6 +123,10 @@ public static class IntroCutscenePatches
}
Info("IntroCutscene ended");
if (CustomGameModeManager.ActiveMode != null)
{
CustomGameModeManager.ActiveMode.Initialize();
}
MiraEventManager.InvokeEvent(new IntroEndEvent(introCutscene));