diff --git a/JotunnModStub/Fenrir/FenrirFormShared.cs b/JotunnModStub/Fenrir/FenrirFormShared.cs index e1a8b72..f412620 100644 --- a/JotunnModStub/Fenrir/FenrirFormShared.cs +++ b/JotunnModStub/Fenrir/FenrirFormShared.cs @@ -87,9 +87,7 @@ namespace RacesOfValheim (hasSleeping ? "sitting puts it to sleep." : "sitting keeps it idle.")); } } - bool sitting = IsSitting(player); - if (hasSleeping) form.SetBool("sleeping", sitting); - DebugSleep(form, player, sitting); + if (hasSleeping) form.SetBool("sleeping", IsSitting(player)); return grounded; } @@ -100,31 +98,6 @@ namespace RacesOfValheim /// never saw it and the Ulv stayed on its feet. Player.StartEmote writes the emote's name on the /// ZDO, which every client reads, so this is right for an onlooker's copy as well. /// - // TEMPORARY DEBUG for the Ulv that will not sleep. Remove with the fix. - private bool lastSitting; - private float nextSleepLog; - private void DebugSleep(Animator form, Player player, bool sitting) - { - if (player == null || player != Player.m_localPlayer) return; - ZNetView nview = player.GetComponent(); - string emote = nview != null && nview.IsValid() ? nview.GetZDO().GetString(ZDOVars.s_emote, "") : "?"; - if (sitting != lastSitting) - { - lastSitting = sitting; - Jotunn.Logger.LogInfo($"[SleepDebug] sitting={sitting} IsSitting={player.IsSitting()} emote='{emote}' hasSleeping={hasSleeping}"); - } - if (!sitting && emote != "sit") return; - if (Time.time < nextSleepLog) return; - nextSleepLog = Time.time + 1f; - string clip = "?"; - var clips = form.GetCurrentAnimatorClipInfo(0); - if (clips.Length > 0 && clips[0].clip != null) clip = clips[0].clip.name; - bool sleepingNow = false; - try { sleepingNow = form.GetBool("sleeping"); } catch {} - Jotunn.Logger.LogInfo($"[SleepDebug] sitting={sitting} emote='{emote}' sleepingBool={sleepingNow} clip='{clip}' " + - $"inTransition={form.IsInTransition(0)} enabled={form.enabled} speed={form.speed}"); - } - private static bool IsSitting(Player player) { if (player == null) return false;