[RelativeSync] attempt at fixing jitter (it did not work, it is very broken)

This commit is contained in:
NotAKidoS 2024-05-27 23:25:24 -05:00
parent c46bc61619
commit 85e3499615
6 changed files with 305 additions and 230 deletions

View file

@ -58,4 +58,25 @@ internal static class NetworkRootDataUpdatePatches
{
ModNetwork.SendRelativeSyncUpdate(); // Send the relative sync update after the network root data update
}
}
internal static class CVRSpawnablePatches
{
private static bool _allowUpdate;
[HarmonyPrefix]
[HarmonyPatch(typeof(CVRSpawnable), nameof(CVRSpawnable.Update))]
private static bool Prefix_CVRSpawnable_Update()
{
return _allowUpdate;
}
[HarmonyPostfix]
[HarmonyPatch(typeof(CVRSpawnable), nameof(CVRSpawnable.FixedUpdate))]
private static void Postfix_CVRSpawnable_FixedUpdate(ref CVRSpawnable __instance)
{
_allowUpdate = true;
__instance.Update();
_allowUpdate = false;
}
}