mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
fix small overlooked behaviours
- fixes issue #45 where the player leave event was in a postfix, when the player character was already destroyed - fixes #46 where modded role options did not have the same change zero behaviour as vanilla ones
This commit is contained in:
2 files changed
+21
-1
No files matched your search
@@ -36,7 +36,7 @@ internal static class AmongUsClientSyncPatch
|
||||
GameModeOption.RpcSyncGamemode(PlayerControl.LocalPlayer, GameModeOption.Value);
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(AmongUsClient), nameof(AmongUsClient.OnPlayerLeft))]
|
||||
public static void PlayerLeftPatch(ClientData data, DisconnectReasons reason)
|
||||
{
|
||||
|
||||
@@ -34,6 +34,11 @@ public static class OptionsPatches
|
||||
__instance.roleChance = 0;
|
||||
}
|
||||
|
||||
if (__instance.roleChance == 0)
|
||||
{
|
||||
__instance.roleMaxCount = 0;
|
||||
}
|
||||
|
||||
__instance.OnValueChanged.Invoke(__instance);
|
||||
return false;
|
||||
}
|
||||
@@ -60,6 +65,11 @@ public static class OptionsPatches
|
||||
__instance.roleChance = 100;
|
||||
}
|
||||
|
||||
if (__instance.roleChance == 0)
|
||||
{
|
||||
__instance.roleMaxCount = 0;
|
||||
}
|
||||
|
||||
__instance.OnValueChanged.Invoke(__instance);
|
||||
return false;
|
||||
}
|
||||
@@ -84,6 +94,11 @@ public static class OptionsPatches
|
||||
__instance.roleMaxCount = 0;
|
||||
}
|
||||
|
||||
if (__instance.roleMaxCount == 0)
|
||||
{
|
||||
__instance.roleChance = 0;
|
||||
}
|
||||
|
||||
__instance.OnValueChanged.Invoke(__instance);
|
||||
return false;
|
||||
}
|
||||
@@ -108,6 +123,11 @@ public static class OptionsPatches
|
||||
__instance.roleMaxCount = __instance.role.MaxCount;
|
||||
}
|
||||
|
||||
if (__instance.roleMaxCount == 0)
|
||||
{
|
||||
__instance.roleChance = 0;
|
||||
}
|
||||
|
||||
__instance.OnValueChanged.Invoke(__instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user