mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2026-01-01 06:07:30 +00:00
[OriginShift] Fixed for 2025r181-hf2
This commit is contained in:
parent
ce30784789
commit
0da225b05c
2 changed files with 10 additions and 6 deletions
|
|
@ -37,7 +37,7 @@ public class OriginShiftMod : MelonMod
|
|||
ApplyPatches(typeof(Patches.CVRObjectSyncPatches)); // remote object pos
|
||||
|
||||
ApplyPatches(typeof(Patches.DbJobsAvatarManagerPatches)); // dynamic bones
|
||||
ApplyPatches(typeof(Patches.CVRPortalManagerPatches)); // portals
|
||||
ApplyPatches(typeof(Patches.AbstractPortalControllerPatches)); // portals
|
||||
ApplyPatches(typeof(Patches.RCC_SkidmarksManagerPatches)); // skidmarks
|
||||
ApplyPatches(typeof(Patches.CVRPickupObjectPatches)); // pickup object respawn height
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ using ABI_RC.Core.Util;
|
|||
using ABI_RC.Systems.Camera;
|
||||
using ABI_RC.Systems.Communications.Networking;
|
||||
using ABI_RC.Systems.Movement;
|
||||
using ABI_RC.Systems.PortalsV2;
|
||||
using ABI.CCK.Components;
|
||||
using DarkRift;
|
||||
using HarmonyLib;
|
||||
|
|
@ -250,19 +251,22 @@ internal static class DbJobsAvatarManagerPatches
|
|||
}
|
||||
}
|
||||
|
||||
// CVRPortalManager
|
||||
internal static class CVRPortalManagerPatches
|
||||
// AbstractPortalController
|
||||
internal static class AbstractPortalControllerPatches
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(CVRPortalManager), nameof(CVRPortalManager.Start))]
|
||||
private static void Postfix_CVRPortalManager_Start(ref CVRPortalManager __instance)
|
||||
[HarmonyPatch(typeof(AbstractPortalController), nameof(AbstractPortalController.Setup))]
|
||||
private static void Postfix_AbstractPortalManager_Setup(ref AbstractPortalController __instance)
|
||||
{
|
||||
if (__instance.PortalSoul.portalType == PortalType.World)
|
||||
return; // only care about user portals
|
||||
|
||||
// parent portal to the object below it using a physics cast
|
||||
Transform portalTransform = __instance.transform;
|
||||
Vector3 origin = portalTransform.position;
|
||||
Vector3 direction = Vector3.down;
|
||||
if (Physics.Raycast(origin, direction, out RaycastHit hit, 0.5f))
|
||||
portalTransform.SetParent(hit.transform);
|
||||
portalTransform.SetParent(hit.transform, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue