mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
add new role information to try and fix broken gamemanager
This commit is contained in:
1 parent
7e541733b7
commit
10a7ffe886
2 files changed
+8
-9
No files matched your search
@@ -7,15 +7,6 @@ namespace MiraAPI.Patches.Events;
|
||||
|
||||
internal static class EndGamePatches
|
||||
{
|
||||
[HarmonyPatch(typeof(GameManager), nameof(GameManager.Awake))]
|
||||
public static class GameManagerAwakePatch
|
||||
{
|
||||
public static void Postfix(GameManager __instance)
|
||||
{
|
||||
__instance.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(GameManager), nameof(GameManager.RpcEndGame))]
|
||||
public static class GameManagerRpcEndGamePatch
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using AmongUs.GameOptions;
|
||||
using Il2CppInterop.Runtime;
|
||||
using Il2CppInterop.Runtime.Injection;
|
||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
||||
using MiraAPI.Networking;
|
||||
using MiraAPI.PluginLoading;
|
||||
using MiraAPI.Utilities;
|
||||
@@ -53,6 +54,8 @@ public static class CustomRoleManager
|
||||
internal static readonly Dictionary<ushort, RoleBehaviour> CustomRoles = [];
|
||||
internal static readonly Dictionary<Type, ushort> RoleIds = [];
|
||||
|
||||
private static Il2CppSystem.Collections.Generic.List<BaseGameSetting>? _emptySettings;
|
||||
|
||||
private static ushort _roleId = 100;
|
||||
|
||||
private static ushort GetNextRoleId()
|
||||
@@ -133,6 +136,11 @@ public static class CustomRoleManager
|
||||
roleBehaviour.MaxCount = customRole.Configuration.MaxRoleCount;
|
||||
roleBehaviour.RoleScreenshot = customRole.Configuration.OptionsScreenshot?.LoadAsset();
|
||||
|
||||
_emptySettings ??= new(0);
|
||||
|
||||
roleBehaviour.AllGameSettings = _emptySettings;
|
||||
roleBehaviour.CustomKillAnimations = RoleManager.Instance.GetRole(RoleTypes.Impostor).CustomKillAnimations;
|
||||
|
||||
if (customRole.Configuration.Icon != null)
|
||||
{
|
||||
var asset = customRole.Configuration.Icon.LoadAsset();
|
||||
|
||||
Reference in new issue
Block a user