mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
fix dummy voting in freeplay
This commit is contained in:
1 parent
f0b2f9ee2a
commit
8f76f21cb1
2 files changed
+17
-1
No files matched your search
@@ -0,0 +1,16 @@
|
|||||||
|
using HarmonyLib;
|
||||||
|
using MiraAPI.Utilities;
|
||||||
|
|
||||||
|
namespace MiraAPI.Patches.Voting;
|
||||||
|
|
||||||
|
[HarmonyPatch(typeof(DummyBehaviour), nameof(DummyBehaviour.Update))]
|
||||||
|
internal static class DummyBehaviourPatch
|
||||||
|
{
|
||||||
|
public static void Postfix(DummyBehaviour __instance)
|
||||||
|
{
|
||||||
|
if (MeetingHud.Instance && __instance.myPlayer.GetVoteData())
|
||||||
|
{
|
||||||
|
__instance.voted = __instance.myPlayer.GetVoteData().VotesRemaining == 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -47,7 +47,7 @@ internal static class MeetingHudPatches
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(MeetingHud.HandleDisconnect), [typeof(PlayerControl), typeof(DisconnectReasons)])]
|
[HarmonyPatch(nameof(MeetingHud.HandleDisconnect), typeof(PlayerControl), typeof(DisconnectReasons))]
|
||||||
public static bool HandleDisconnect(MeetingHud __instance, PlayerControl pc)
|
public static bool HandleDisconnect(MeetingHud __instance, PlayerControl pc)
|
||||||
{
|
{
|
||||||
if (!AmongUsClient.Instance.AmHost || __instance.playerStates is null || !pc || !GameData.Instance)
|
if (!AmongUsClient.Instance.AmHost || __instance.playerStates is null || !pc || !GameData.Instance)
|
||||||
|
|||||||
Reference in new issue
Block a user