mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
[OriginShift] Fix Spawnable & Object Sync cached net pos
This commit is contained in:
parent
ab8ccbb67f
commit
512ffe38b8
3 changed files with 100 additions and 1 deletions
|
@ -63,9 +63,10 @@ internal static class CVRSpawnablePatches
|
|||
[HarmonyPatch(typeof(CVRSpawnable), nameof(CVRSpawnable.Start))]
|
||||
private static void Postfix_CVRSpawnable_Start(ref CVRSpawnable __instance)
|
||||
{
|
||||
Transform wrapper = __instance.transform.parent;
|
||||
__instance.AddComponentIfMissing<OriginShiftSpawnableReceiver>();
|
||||
|
||||
// test adding to the wrapper of the spawnable
|
||||
Transform wrapper = __instance.transform.parent;
|
||||
wrapper.AddComponentIfMissing<OriginShiftTransformReceiver>();
|
||||
wrapper.AddComponentIfMissing<OriginShiftParticleSystemReceiver>();
|
||||
wrapper.AddComponentIfMissing<OriginShiftTrailRendererReceiver>();
|
||||
|
@ -215,6 +216,13 @@ internal static class CVRSyncHelperPatches
|
|||
|
||||
internal static class CVRObjectSyncPatches
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(CVRObjectSync), nameof(CVRObjectSync.Start))]
|
||||
private static void Postfix_CVRObjectSync_Start(ref CVRObjectSync __instance)
|
||||
{
|
||||
__instance.gameObject.AddComponentIfMissing<OriginShiftObjectSyncReceiver>();
|
||||
}
|
||||
|
||||
[HarmonyPrefix] // inbound object sync
|
||||
[HarmonyPatch(typeof(CVRObjectSync), nameof(CVRObjectSync.receiveNetworkData))]
|
||||
[HarmonyPatch(typeof(CVRObjectSync), nameof(CVRObjectSync.receiveNetworkDataJoin))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue