From 4cb6da801bf669e49a2002fb848b50fff33b0dd9 Mon Sep 17 00:00:00 2001 From: kanym Date: Sat, 17 Oct 2026 19:09:38 +0200 Subject: [PATCH] Revert "debug: log the Ulv's sleep state while the player sits (temporary)" This reverts commit 2df8264c42279f941d0aae6ef31f27271ccd6009. --- JotunnModStub/Fenrir/FenrirFormShared.cs | 29 +----------------------- 1 file changed, 1 insertion(+), 28 deletions(-) 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;