[AvatarScaleMod] Fix issue with ClearAvatar() running twice, breaking scale persistance.

This commit is contained in:
NotAKidoS 2023-05-17 12:07:17 -05:00
parent 05374459be
commit 5c66138f2f

View file

@ -26,6 +26,9 @@ class PlayerSetupPatches
[HarmonyPatch(typeof(PlayerSetup), nameof(PlayerSetup.ClearAvatar))]
static void Prefix_PlayerSetup_ClearAvatar(ref PlayerSetup __instance, ref float ____avatarHeight)
{
// dumb fix cause ClearAvatar() runs twice when switching
if (__instance._avatar == null) return;
if (!AvatarScaleMod.EntryEnabled.Value) return;
if (!IsSupportedAvatar(__instance.animatorManager) && !AvatarScaleMod.EntryPersistAnyways.Value)