[OriginShift] Fixed pickup object respawn height

This commit is contained in:
NotAKidoS 2024-06-18 17:19:29 -05:00
parent a03a0c4884
commit 773c651291
5 changed files with 61 additions and 9 deletions

View file

@ -63,7 +63,7 @@ internal static class CVRSpawnablePatches
[HarmonyPatch(typeof(CVRSpawnable), nameof(CVRSpawnable.Start))]
private static void Postfix_CVRSpawnable_Start(ref CVRSpawnable __instance)
{
//__instance.AddComponentIfMissing<OriginShiftSpawnableReceiver>(); //todo: investigate if this is needed
__instance.AddComponentIfMissing<OriginShiftSpawnableReceiver>(); //todo: investigate if this is needed
// test adding to the wrapper of the spawnable
Transform wrapper = __instance.transform.parent;
@ -216,12 +216,12 @@ 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>(); // todo: investigate if this is needed
// }
[HarmonyPostfix]
[HarmonyPatch(typeof(CVRObjectSync), nameof(CVRObjectSync.Start))]
private static void Postfix_CVRObjectSync_Start(ref CVRObjectSync __instance)
{
__instance.gameObject.AddComponentIfMissing<OriginShiftObjectSyncReceiver>(); // todo: investigate if this is needed
}
[HarmonyPrefix] // inbound object sync
[HarmonyPatch(typeof(CVRObjectSync), nameof(CVRObjectSync.receiveNetworkData))]
@ -282,4 +282,14 @@ internal static class CVRPortalManagerPatches
}
}
internal static class CVRPickupObjectPatches
{
[HarmonyPostfix]
[HarmonyPatch(typeof(CVRPickupObject), nameof(CVRPickupObject.Start))]
private static void Postfix_CVRPickupObject_Start(ref CVRPickupObject __instance)
{
__instance.gameObject.AddComponentIfMissing<OriginShiftPickupObjectReceiver>();
}
}
#endif