From 328e7c266de5a0f263ced1dcd8f15536a4b74cf7 Mon Sep 17 00:00:00 2001 From: Kirill Polushin Date: Mon, 8 Jun 2026 01:31:58 +0300 Subject: [PATCH] Disable desync log stack trace unwinding for non-X86/X64 arches This is implemented only for x86 and using it on other arches breaks the game tick. --- Source/Client/Desyncs/DeferredStackTracing.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Client/Desyncs/DeferredStackTracing.cs b/Source/Client/Desyncs/DeferredStackTracing.cs index 1f4b1503..db53da2d 100644 --- a/Source/Client/Desyncs/DeferredStackTracing.cs +++ b/Source/Client/Desyncs/DeferredStackTracing.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Reflection; +using System.Runtime.InteropServices; using HarmonyLib; using Multiplayer.Client.Patches; using Multiplayer.Common; @@ -25,6 +26,9 @@ static IEnumerable TargetMethods() public static int acc; + private static bool SupportsDeferredStackTracing => + RuntimeInformation.ProcessArchitecture is Architecture.X64 or Architecture.X86; + public static void Postfix() { if (Native.LmfPtr == 0) return; @@ -43,6 +47,7 @@ public static void Postfix() public static bool ShouldAddStackTraceForDesyncLog() { + if (!SupportsDeferredStackTracing) return false; if (Multiplayer.Client == null) return false; if (Multiplayer.settings.desyncTracingMode == DesyncTracingMode.None) return false; if (Multiplayer.game == null) return false;