diff --git a/Source/Client/Patches/Determinism.cs b/Source/Client/Patches/Determinism.cs index 5412aaf0..388db51f 100644 --- a/Source/Client/Patches/Determinism.cs +++ b/Source/Client/Patches/Determinism.cs @@ -20,12 +20,14 @@ namespace Multiplayer.Client.Patches [HarmonyPatch(nameof(PawnTweener.TweenedPos), MethodType.Getter)] static class DrawPosPatch { - static bool Prefix() => Multiplayer.Client == null || Multiplayer.InInterface; + public static bool returnTruePosition = false; + + static bool Prefix() => Multiplayer.Client == null || Multiplayer.InInterface || returnTruePosition; // Give the root position during ticking static void Postfix(PawnTweener __instance, ref Vector3 __result) { - if (Multiplayer.Client == null || Multiplayer.InInterface) return; + if (Multiplayer.Client == null || Multiplayer.InInterface || returnTruePosition) return; __result = __instance.TweenedPosRoot(); } } diff --git a/Source/Client/Patches/Patches.cs b/Source/Client/Patches/Patches.cs index a0c35a87..37e4e25c 100644 --- a/Source/Client/Patches/Patches.cs +++ b/Source/Client/Patches/Patches.cs @@ -9,6 +9,7 @@ using System.Reflection.Emit; using System.Text.RegularExpressions; using System.Xml.Linq; +using Multiplayer.Client.Patches; using UnityEngine; using Verse; using Verse.AI; @@ -581,4 +582,12 @@ static void FixStorage(IStoreSettingsParent __instance, StorageSettings ___allow ___allowedNutritionSettings.owner ??= __instance; } } + + [HarmonyPatch(typeof(MoteAttachLink), nameof(MoteAttachLink.UpdateDrawPos))] + static class MoteAttachLinkUsesTruePosition + { + static void Prefix() => DrawPosPatch.returnTruePosition = true; + + static void Finalizer() => DrawPosPatch.returnTruePosition = false; + } }